rest_api_allowed_public_metadata

The Jetpack by WordPress.com rest api allowed public metadata hook.

Description

apply_filters( 'rest_api_allowed_public_metadata', (unknown) $whitelisted_meta ); 

Parameters (1)

0. $whitelisted_meta (unknown)
The whitelisted meta.

Usage

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

Defined (2)

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

/json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php  
  1. if ( in_array( $key, apply_filters( 'rest_api_allowed_public_metadata', $whitelisted_meta ) ) ) 
/json-endpoints/class.wpcom-json-api-post-endpoint.php  
  1. if ( in_array( $key, apply_filters( 'rest_api_allowed_public_metadata', $whitelisted_meta ) ) )