|
What Import Plugin is advised to use?
Started by: simonV-3
in: Toolset Professional Support
Quick solution available
|
|
2 |
3 |
4 years ago
simonV-3
|
|
Can’t expose relationship intermediary posts to WP API
Started by: parisK
in: Toolset Professional Support
Quick solution available
Problem:
The user would like to publish intermediary posts on the WordPress REST API.
Solution:
This needs custom code to make the intermediary post type public in the REST API. This is an example:
add_filter( 'register_post_type_args', 'my_post_type_args', 10, 2 );
function my_post_type_args( $args, $post_type ) {
if ( 'couples' === $post_type ) {
$args['show_in_rest'] = true;
// Optionally customize the rest_base or rest_controller_class
$args['rest_base'] = 'couples';
$args['rest_controller_class'] = 'WP_REST_Posts_Controller';
}
return $args;
}
More about it on this reply https://toolset.com/forums/topic/cant-expose-relationship-intermediary-posts-to-wp-api/#post-2161249
|
|
2 |
5 |
4 years ago
parisK
|