rest_api_init
This is a WordPress - rest_api_init hook. The plugin just uses it.
Fires when preparing to serve a REST API request.
Usage
add_action( 'rest_api_init', 'wp_kama_rest_api_init_action' ); /** * Function for `rest_api_init` action-hook. * * @param WP_REST_Server $wp_rest_server Server object. * * @return void */ function wp_kama_rest_api_init_action( $wp_rest_server ){ // action... }
- $wp_rest_server(WP_REST_Server)
- Server object.
Where the hook is called
rest_api_init
woocommerce/includes/cli/class-wc-cli-runner.php 59
do_action( 'rest_api_init', $wp_rest_server );
Where the hook is used in WooCommerce
woocommerce/includes/admin/helper/class-wc-helper-admin.php 43
add_filter( 'rest_api_init', array( __CLASS__, 'register_rest_routes' ) );
woocommerce/includes/admin/helper/class-wc-helper-orders-api.php 24
add_filter( 'rest_api_init', array( __CLASS__, 'register_rest_routes' ) );
woocommerce/includes/admin/helper/class-wc-helper-subscriptions-api.php 26
add_filter( 'rest_api_init', array( __CLASS__, 'register_rest_routes' ) );
woocommerce/includes/class-wc-brands.php 67
add_action( 'rest_api_init', array( $this, 'rest_api_register_routes' ) );
woocommerce/includes/class-woocommerce.php 307
self::add_action( 'rest_api_init', array( $this, 'register_wp_admin_settings' ) );
woocommerce/includes/rest-api/Server.php 32
add_action( 'rest_api_init', array( $this, 'register_rest_routes' ), 10 );
woocommerce/src/Admin/API/Init.php 48
add_action( 'rest_api_init', array( $this, 'rest_api_init' ) );
woocommerce/src/Admin/Features/Blueprint/Init.php 30
add_action( 'rest_api_init', array( $this, 'init_rest_api' ) );
woocommerce/src/Admin/Features/ProductBlockEditor/Init.php 75
add_action( 'rest_api_init', array( $this, 'register_layout_templates' ) );
woocommerce/src/Admin/Features/ProductBlockEditor/Init.php 76
add_action( 'rest_api_init', array( $this, 'register_user_metas' ) );
woocommerce/src/Blocks/Shipping/ShippingController.php 64
add_action( 'rest_api_init', array( $this, 'register_settings' ) );
woocommerce/src/Internal/Admin/WCAdminUser.php 21
add_action( 'rest_api_init', array( $this, 'register_user_data' ) );