3 simple script to manage the WordPress admin
Adding a caption for the post thumbnail
Everything is simple, if you need to leave a comment for your moderators, then this can be done using the code for inserting text into the metabox of the thumbnail right below it.
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_html');
function add_featured_image_html( $html ) {
return $html .= '<p>A record thumbnail is a small picture, which is added by an administrator and is usually displayed at the beginning of the post.</p>';
}By adding code, you will get a signature under the thumbnail block in the admin panel.
Adding a Gravatar.
We optimize the admin panel to increase the loyalty of site users. Instead of favicon your site, which the user saw during the search and during registration, show him his own gravatar. In addition, the avatar from the gravatar will be displayed in the user profile.
function gravatar_favicon() {
$GetTheHash = md5(strtolower(trim(get_bloginfo('admin_email'))));
return 'https://www.gravatar.com/avatar/' . $GetTheHash . '?s=16';
}
function favicon() {
if ( is_user_logged_in() ) {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.gravatar_favicon().'" />';
}
}
add_action('wp_head', 'favicon');
By the way, who did not register in the service gravatar? I advise everyone to do it. It’s very nice when on popular sites part of the admin area is already empty and you don’t need to fill it out, or registered on a new site and your avatar is already there ).
Changing the default text in the admin panel. When entering a title.
Another useful code for those, who wants to remake the WordPress admin area for themselves.
function title_text_input( $title ){
return $title = 'Enter new title';
}
add_filter( 'enter_title_here', 'title_text_input' );
/*

- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.





