rest_url_prefix

Filters the REST URL prefix.

Description

add_filter( 'rest_url_prefix', (string) $jetpack_index_permalinks_rest_api_url, (int) $int ); 

Parameters (2)

0. $jetpack_index_permalinks_rest_api_url (string) => 'jetpack_index_permalinks_rest_api_url'
The jetpack index permalinks rest api url.
1. $int (int) => 999
The int.

Usage

To run the hook, copy the example below.
  1. $jetpack_index_permalinks_rest_api_url = apply_filters( 'rest_url_prefix', $jetpack_index_permalinks_rest_api_url, $int ); 
  2.  
  3. if ( !empty( $jetpack_index_permalinks_rest_api_url ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the rest_url_prefix callback 
  2. function filter_rest_url_prefix( $jetpack_index_permalinks_rest_api_url, $int ) { 
  3. // make filter magic happen here... 
  4. return $jetpack_index_permalinks_rest_api_url
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'rest_url_prefix', 'filter_rest_url_prefix', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'rest_url_prefix', 'filter_rest_url_prefix', 10, 2 ); 

Defined (1)

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

/jetpack.php  
  1. add_filter( 'rest_url_prefix', 'jetpack_index_permalinks_rest_api_url', 999 );