Support » Plugins » add_theme_support for post-thumbnails is destructive

  • It seems that when using add_theme_support for post-thumbnails in a plugin – which should have no knowledge of other plugins or post-types – overwrites current value for post-thumbnails.

    Here is my example code, where foo represents my custom posttype

    add_theme_support('post-thumbnails', array('post', 'foo'))

    Observe the code of wp-includes/theme.php here https://developer.wordpress.org/reference/functions/add_theme_support/#source-code

    Notice, that in the case of 'post-thumbnails' it simply overwrites whatever has already been stored. What is the proper way to handle this in a plugin?

  • The topic ‘add_theme_support for post-thumbnails is destructive’ is closed to new replies.