Created
August 21, 2024 07:31
-
-
Save iworks/991026c99b6b7603e4ede31c58e9ae34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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