Skip Navigation

[Resolved] Types Custom Fields in Advanced Ads post

This support ticket is created 2 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2304393

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

#2304685

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