PHP code example of ankitpokhrel / dynamic-featured-image
1. Go to this page and download the library: Download ankitpokhrel/dynamic-featured-image library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ankitpokhrel / dynamic-featured-image example snippets
function allowed_post_types() {
return array('post'); //show DFI only in post
}
add_filter('dfi_post_types', 'allowed_post_types');
function blocked_post_types() {
return array('page'); //block DFI in page
}
add_filter('dfi_post_type_user_filter', 'blocked_post_types');
function set_metabox_title( $title ) {
return "My custom metabox title";
}
add_filter('dfi_set_metabox_title', 'set_metabox_title');