Custom Fields


If our default field options are not enough, you can extend the available field options with the functions below:

Text Field

Add a new text-dropdown value, everytime an image gets generated, the closure below will be ran and has to return a string value.

/images/docs/wordpress-text-field.png

placid_add_text_field('movie-title', "Movie Title", function ($params) {

    $params['object_type']; // - post, tag, category  
    $params['object_id']; // - null || id 
    $params['post_type']; // - null || custom_post type = 'movies'
    $params['image']; // - ogimage/twitter/pinterest

    // - must return string
    return "MOVIE TITLE";
});

Image Field

Add a new text-dropdown value, everytime an image gets generated, the closure below will be ran and has to return the absolute URL to the image.

/images/docs/wordpress-text-field.png

placid_add_image_field('movie-poster', "Movie Poster", function ($params) {

    $params['object_type']; // - post, tag, category  
    $params['object_id']; // - null || id 
    $params['post_type']; // - null || custom_post type = 'movies'
    $params['image']; // - ogimage/twitter/pinterest

    // - must be publicly accessable URL of image
    return "https://URL-TO-POSTER.png";
});