Use ACF image field as thumbnail input

Use ACF image field as thumbnail input

Standard Wordpress thumbnail input may be replaced with an ACF image field which is far more flexible/customizable. In order to do that you just have to give it a name of _thumbnail_id. I'm not sure if it is possible with a visual editor (because I don't use it), but for sure you can do that using ACF PHP API. Here is the code which will generate a field for thumbnail image selection:

array(
  'key' => 'field_thumbnail_id',
  'name' => '_thumbnail_id',
  'type' => 'image',
  'label' => 'Custom thumbnail input',
  'instructions' => 'Some more instructions below the label',
  'return_format' => 'id',
),

Of course all other image field settings might be used here e.g. min_width, min_height, max_size etc. For more info please refer to the official image field documentation at https://www.advancedcustomfields.com/resources/register-fields-via-php/.