I am attempting to create and use custom fields and meta box inside an Advanced Ads third-party post (custom post type). Here is a post with instructions by Advanced Ads for how to accomplish this with Advanced Custom Fields. I would like to accomplish the same thing (creating custom fields and inserting them into the ads). Is this possible?
Here is the post from Advanced Ads website: hidden link
Hi,
Thank you for contacting us and I'd be happy to assist.
When a custom field group is added using the Toolset Types, its meta box ID for the post edit screen is generated in this format: wpcf-group-{field-group-slug}
For example, suppose the field group name is 'Book Info' and the slug for that field group would be 'book-info'. And this field group's meta box ID would be 'wpcf-group-book-info'.
To whitelist/allow this field group on the Ads post edit screen, the code will look like this:
( ref: hidden link )
add_filter( 'advanced-ads-ad-edit-allowed-metaboxes', 'my_advanced_ads_whitelist_meta_box');
function my_advanced_ads_whitelist_meta_box( $meta_boxes ){
$meta_boxes[] = "wpcf-group-book-info"; // ID of the meta box
return $meta_boxes;
}
The above code snippet can be included in the active theme's "functions.php" file.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar