Plugin throws error
-
Hi Richard
We are using this snippet to get sub page by slug something like wp-json/wp/v2/pages?path=/parent-slug/child-slug
add_filter('rest_page_query', function ($args, $request){ $path = $request->get_param('path'); if (!empty($path)) { $pageByPath = get_page_by_path($path, OBJECT, 'page'); // overwrite the page id with the page id by path $args['p'] = $pageByPath->ID; } return $args; }, 10, 2);
When we install your plugin it throws error.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Plugin throws error’ is closed to new replies.