Fires functions hooked onto `init` by the theme for the purpose of the REST API.


do_action( 'restapi_theme_init' ); 

The REST API does not load the theme when processing requests. To enable theme-based functionality, the API will load the /functions.php,, '/inc/jetpack.compat.php', /inc/jetpack.php, /includes/jetpack.compat.php files of the theme (parent and child) and copy functions hooked onto init' within those files.


To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'restapi_theme_init' ); 
The following example is for adding a hook callback.
  1. // define the restapi_theme_init callback 
  2. function action_restapi_theme_init( ) { 
  3. // make action magic happen here... 
  4. }; 
  6. // add the action 
  7. add_action( 'restapi_theme_init', 'action_restapi_theme_init', 10, 0 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'restapi_theme_init', 'action_restapi_theme_init', 10, 0 ); 

Defined (1)

The action is defined in the following location(s).

  1. do_action( 'restapi_theme_init' );