Finally sorted it out.
As I am using Advanced Custom Fields, I need to use the acf/save_post
hook with a priority greater than 10, so the get_field()
functions are available.
Downside is that this hook runs for every post type. As opposed to the WP native save_post
hook, with the ACF one you can’t hook it for a specific custom post type.
So I also added a condition to check if the post is of type “interel-tv-videos”, like if(!has_post_thumbnail($post_ID) and get_post_type($post_ID) == "interel-tv-videos"):
Related Posts:
- How come Featured Image isn’t showing up in my Custom Post Type?
- add_image_size() for specific Post Types
- How to disable generation of default image sizes for some custom post types?
- Using add_theme_support inside a plugin
- Custom user role cannot see or modify featured image
- Make featured image required
- How to remove “featured image” functionality from a custom post type?
- Featured Image Panel Missing From Custom Post Type in WordPress 3.2
- set_post_thumbnail_size in percent, not pixels?
- Best way to filter featured image text for a custom post type?
- If featured image doesn’t exist, show post content
- set and unset the custom field value
- How I upload, save and set a featured image from my frontend?
- Trouble adding custom featured image for custom taxonomy TERMS
- How can i place Feature Image under title field in wp-admin?
- How to remove thumbnail sizes for specific post type on a child theme?
- Featured image metabox not showing up
- image srcset returns false
- How to use different featured image size for a custom post type?
- get_the_post_thumbnail() returning empty string on custom post type
- Change admin post thumbnail size for custom post type only
- How to add multiple featured image in meta box in post editor?
- How to List Thumbnails based on Custom Categories
- reference the current category being used in the category.php page
- add_image_size for post type
- Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type
- Change post featured image on hover
- Show Post Thumbnail In Custom Post From Other CPT
- is there a way to retrieve posts that do not have a featured image assigned?
- get custom post type thumbnail
- Using global $post; to get featured image for custom post via WP_Query
- Displaying media for custom post type
- Custom Image Thumbnails of Different Sizes
- How to change post featured image using a custom field of category?
- Force documents to appear in Featured Image dialogue
- Change Featured Image / Thumbnail CMS Description
- Featured Images does not show in custom post type
- Loading custom post thumbnail into stream
- Is it possible to show full content of the post when there is only one post in a grid?
- How to set YouTube video as featured image?
- Link to full size post thumbnail
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- unable to show custom post type featured image
- How do you create a custom template to display a category with an image and related posts below?
- how to post default thumbnail if post not created yet
- get_the_post_thumbnail_url(‘full’) returns empty from custom post type
- Set featured image to archive.php
- Unable to set featured image
- Post-thumbnail only for specific post-types?
- Featured image size in column
- False Positive on has_post_thumbnail
- 3 random images from custom post type, each in a div with a diffrent class
- Custom post doesn’t show featured image
- Is it possible to add posts and images (auto resize) for custom post types with a script?
- Auto post creation
- Dynamic pages for linked categories and content
- Using Image Sizes for Custom Post Types outside the Loop
- link featured image to external link
- Cannot upload featured image to a custom post type
- Thumbnails Not Generating
- Add Permalink to Post Thumbnail, syntax code issues
- Need help with simple “if statement” checks to output particlular CPT data depending on what client uploads/fills out
- How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?
- i need to have a tab with gategory post
- Put featured image under post title in admin area
- How to add a default predefined thumbnail when creating a brand new post?
- Display featured images from custom post type in the homepage template
- why featured image option isn’t showing in custom post type?
- retrieve custom post image through widget
- How To Loop Through list with Custom Post Types
- Thumbnails for custom post not showing up in query
- How to scroll through post thumbnails?
- Featured image in admin on custom post type
- Customized featured image doesn’t refresh in post admin metabox after upload/insert
- Specific Thumbnail Size for Custom Content Type
- Link to larger thumbnail in custom query (with custom post-types)
- Front end post or photo or both
- Delete old thumbnail when updating new
- set_post_thumbnail or media_sideload_image adds image multiple times in media library
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?
- What are the differences between custom post type and custom page templates?
- Does anyone have any frameworks to setup custom post types and related actions/filters?
- register_post_type – rewrite / feeds, what’s it for?
- Why are navigation items saved in the database?
- Deleting Custom Posts & Meta Data on Uninstall
- Addition of custom option panel crashes Media Library & Admin Area
- Custom Post Type Metadata Not Saving
- Custom Meta Box Causing Error: “Are you sure you want to do this? Please try again.”
- How to Query in WordPress which shows Alphabetic Posts?
- Using breadcrumb to return from single-page to list
- Why do I need to register my custom post type a second time when flushing rewrite rules?
- Change permalink for custom post type?
- Use a different URL path / permalink for CPT
- Delete all custom posts then upload a new CSV of events
- Slugs on hierarchical taxonomies
- All custom posts are not showing up
- How to show animal lineage/pedigree in WordPress?
- Order custom post type is beign ignored
- Send email on creation of custom post type and use get_post_meta()