1

Is there a filter for when a Featured Image is set/unset or changed.

I need to delete transient data when the above occurs.

2

The post featured image ID is stored as post metadata, so I would recommend hooking into the update_post_meta or update_post_metadata hooks, and then query the post meta for '_thumbnail_id' being set.

See this related answer from Jan Fabry.

1

You can use 'admin_post_thumbnail_html'. The simple function below will append 'This is a lovely image' to the image returned when you set the post featured image buut since $content is just an HTML string you can manipulate it in any way you want.

add_filter( 'admin_post_thumbnail_html', 'my_image_selected', 10, 2 );
function my_image_selected( $content, $post_id ) {
    return $content . 'This is a lovely image';
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.