Post Thumbnail HTML
Content can be added to the post thumbnail box using the admin_post_thumbnail_html
filter. This code can be added to a theme’s functions.php
or a plugin. If the sizing guidelines are tightly coupled to the theme, I’d probably put it in functions.php
. If you want this text to be present when switching themes, I’d go with the plugin approach.
add_filter( 'admin_post_thumbnail_html', 'wpse240830_admin_post_thumbnail_html', 10, 3 );
function wpse240830_admin_post_thumbnail_html( $content, $post_id, $thumbnail_id ) {
$content .= __( 'Set featured image (837px x 467px)', 'your-text-domain' );
return $content;
}
Creating a plugin
Creating a plugin is pretty straight forward. The Codex article Writing a Plugin and the Plugin Handbook are good places to start. In short, you just create a php file in the plugin directory which contains a special header. Put your code in the plugin file, then activate it.
<?php
/*
Plugin Name: WPSE Plugin
Plugin URI: https://developer.wordpress.org/plugins/the-basics/
Description: Basic WordPress Plugin Header Comment
Version: 0.0.1
Author: http://wordpress.stackexchange.com/
Author URI: http://wordpress.stackexchange.com/
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wpse
Domain Path: /languages
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Add plugin code here.