Do not copy ACF field
-
Hello,
I want to not copy an ACF field during the duplication. My ACF field is field_5784087756dbe. I’ve tried to add it in the “do not copy these fields” in the settings page, but it still being copied.
I’ve tried with this code in functions.php :/** * Filters out custom fields from being duplicated in addition to the defaults. * * @param array $meta_excludelist The default exclusion list, based on the “Do not copy these fields” setting, plus some other field names. * * @return array The custom fields to exclude. */ function my_custom_fields_filter( $meta_excludelist ) { // Merges the defaults array with our own array of custom fields. return array_merge( $meta_excludelist, [ 'field_5784087756dbe' ] ); } add_filter( 'duplicate_post_excludelist_filter', 'my_custom_fields_filter' );
Same result. And this filter seems to not even being fired. Can you help me ?
Thank you very much.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Do not copy ACF field’ is closed to new replies.