wpcom_json_api_xmlrpc_scheme

Filters the URL scheme used when querying your site's REST API endpoint.

Description

apply_filters( 'wpcom_json_api_xmlrpc_scheme', $parse_url ); 

Parameters (1)

0. $parse_url
Parse_url( get_option( home ), PHP_URL_SCHEME ) URL scheme parsed from home URL.

Usage

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

Defined (1)

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

/json-endpoints/class.wpcom-json-api-get-site-endpoint.php  
  1. $xmlrpc_scheme = apply_filters( 'wpcom_json_api_xmlrpc_scheme', parse_url( get_option( 'home' ), PHP_URL_SCHEME ) );