WPCOM_JSON_API_Metadata

Utility classes that don't necessarily have a home yet.

Defined (1)

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

/sal/class.json-api-metadata.php  
  1. class WPCOM_JSON_API_Metadata { 
  2. public static function is_public( $key ) { 
  3. if ( empty( $key ) ) 
  4. return false; 
  5.  
  6. // Default whitelisted meta keys. 
  7. $whitelisted_meta = array( '_thumbnail_id' ); 
  8.  
  9. // whitelist of metadata that can be accessed 
  10. /** This filter is documented in json-endpoints/class.wpcom-json-api-post-endpoint.php */ 
  11. if ( in_array( $key, apply_filters( 'rest_api_allowed_public_metadata', $whitelisted_meta ) ) ) 
  12. return true; 
  13.  
  14. if ( 0 === strpos( $key, 'geo_' ) ) 
  15. return true; 
  16.  
  17. if ( 0 === strpos( $key, '_wpas_' ) ) 
  18. return true; 
  19.  
  20. return false; 
  21.  
  22. public static function is_internal_only( $key ) { 
  23.  
  24. if ( 0 === strpos( $key, '_jetpack_') ) 
  25. return true; 
  26.  
  27. if ( 0 === strpos( $key, '_elasticsearch_') ) 
  28. return true; 
  29.  
  30. return false;