Skip to content

Instantly share code, notes, and snippets.

@iworks
Created August 21, 2024 07:31
Show Gist options
  • Save iworks/991026c99b6b7603e4ede31c58e9ae34 to your computer and use it in GitHub Desktop.
Save iworks/991026c99b6b7603e4ede31c58e9ae34 to your computer and use it in GitHub Desktop.
<?php
/**
* filter field named "foo"
*/
add_filter(
'orphan_replace_acf',
function( $filter, $value, $post_id, $field ) {
/**
* check by field name
*/
if ( $field['name'] === 'foo' ) {
return false;
}
/**
* check by field key
*/
if ( $field['key'] === 'field_66c595249bad6' ) {
return false;
}
return $filter;
},
10,
4
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment