acf/schema/post_field_objects
Filters the field objects before retrieval, allowing posts to provide custom data.
This is useful for posts that need custom field data handling. Return a non-null value to short-circuit the default get_field_objects() call.
Usage
add_filter( 'acf/schema/post_field_objects', 'wp_kama_acf_schema_post_field_objects_filter', 10, 3 );
/**
* Function for `acf/schema/post_field_objects` filter-hook.
*
* @param array|null $field_objects The field objects array, or null to use default behavior.
* @param WP_Post $post The post object.
* @param string $post_type The post type.
*
* @return array|null
*/
function wp_kama_acf_schema_post_field_objects_filter( $field_objects, $post, $post_type ){
// filter...
return $field_objects;
}
- $field_objects(array|null)
- The field objects array, or null to use default behavior.
- $post(WP_Post)
- The post object.
- $post_type(string)
- The post type.
Changelog
| Since 6.8.0 | Introduced. |
Where the hook is called
acf/schema/post_field_objects
acf/src/AI/GEO/Outputs/Posts.php 124
$field_objects = apply_filters( 'acf/schema/post_field_objects', null, $post, $post_type );