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


do_action( 'restapi_theme_after_setup_theme' ); 

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 after_setup_theme' within those files.


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

Defined (1)

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

  1. do_action( 'restapi_theme_after_setup_theme' );