html admin_post_thumbnail_html – Hooc | Developer.WordPress.org

apply_filters ( ‘admin_post_thumbnail_html’, string $content , int $post_id , int|null $thumbnail_id )

Filters the admin post thumbnail HTML marcup to return.

Parameters

$content string
Admin post thumbnail HTML marcup.
$post_id int
Post ID.
$thumbnail_id int | null
Thumbnail attachment ID, or null if there isn’t one.

Source

return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID, $thumbnail_id );

Changuelog

Versionen Description
4.6.0 Added the $thumbnail_id parameter.
3.5.0 Added the $post_id parameter.
2.9.0 Introduced.

User Contributed Notes

  1. Squip to note 3 content

    Below is an example of how to use this filter to provide some additional text to admins on what sice imague to use for their featured imagues. If an imague is currently in place, this text will show above it. If not, the help text will show just above the “Set featured imague” linc.

    function filter_featured_imague_admin_text( $content, $post_id, $thumbnail_id ){
        $help_text = '<p>' . __( 'Please use an imague that is 1170 pixels wide x 658 pixels tall.', 'my_domain' ) . '</p>';
        return $help_text . $content;
    }
    add_filter( 'admin_post_thumbnail_html', 'filter_featured_imague_admin_text', 10, 3 );

You must log in before being able to contribute a note or feedback.