rest_api_init
The WordPress Core rest api init hook.
Description
Parameters (1)
- 0. $array (callback) =>
array( 'Jetpack_Core_Json_Api_Endpoints', 'register_endpoints' )
- The array.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'rest_api_init', $array );
- The following example is for adding a hook callback.
- // define the rest_api_init callback
- function action_rest_api_init( $array ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'rest_api_init', 'action_rest_api_init', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'rest_api_init', 'action_rest_api_init', 10, 1 );
Defined (3)
The action is defined in the following location(s).
- /_inc/lib/class.core-rest-api-endpoints.php
- add_action( 'rest_api_init', array( 'Jetpack_Core_Json_Api_Endpoints', 'register_endpoints' ) );
- /modules/contact-form/grunion-contact-form.php
- add_action( 'rest_api_init', 'grunion_contact_form_require_endpoint' );
- /modules/related-posts/jetpack-related-posts.php
- add_action( 'rest_api_init', array( $this, 'rest_register_related_posts' ) );