We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I was looking for something like this but I would be good to support not just posts.
I did some quick change to your plugin. Works for me but it surely needs some testing.
function add_custom_data() { // Register the post type fields $post_types = get_post_types( array( 'public' => true ), 'objects' ); foreach($post_types as $post_type) { $post_type_name = $post_type->name; $show_in_rest = ( isset( $post_type->show_in_rest ) && $post_type->show_in_rest ) ? true : false; if($show_in_rest) { register_rest_field($post_type_name, 'acf_fields', array( 'get_callback' => array($this, 'get_custom_data'), 'update_callback' => array($this, 'update_custom_data'), 'schema' => null ) ); } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I was looking for something like this but I would be good to support
not just posts.
I did some quick change to your plugin. Works for me but it surely needs some testing.
The text was updated successfully, but these errors were encountered: