WP_REST_Comments_Controller example



    // Users.     $controller = new WP_REST_Users_Controller();
    $controller->register_routes();

    // Application Passwords     $controller = new WP_REST_Application_Passwords_Controller();
    $controller->register_routes();

    // Comments.     $controller = new WP_REST_Comments_Controller();
    $controller->register_routes();

    $search_handlers = array(
        new WP_REST_Post_Search_Handler(),
        new WP_REST_Term_Search_Handler(),
        new WP_REST_Post_Format_Search_Handler(),
    );

    /** * Filters the search handlers to use in the REST search controller. * * @since 5.0.0 * * @param array $search_handlers List of search handlers to use in the controller. Each search * handler instance must extend the `WP_REST_Search_Handler` class. * Default is only a handler for posts. */
Home | Imprint | This part of the site doesn't use cookies.