wpcom_json_api_attachment_cast_and_filter

Filter the documentation returned for a post attachment.

Description

apply_filters( 'wpcom_json_api_attachment_cast_and_filter', (array) $docs ); 

Parameters (1)

0. $docs (array)
Array of documentation about a post attachment.

Usage

To run the hook, copy the example below.
  1. $docs = apply_filters( 'wpcom_json_api_attachment_cast_and_filter', $docs ); 
  2.  
  3. if ( !empty( $docs ) ) { 
  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_attachment_cast_and_filter callback 
  2. function filter_wpcom_json_api_attachment_cast_and_filter( $docs ) { 
  3. // make filter magic happen here... 
  4. return $docs
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wpcom_json_api_attachment_cast_and_filter', 'filter_wpcom_json_api_attachment_cast_and_filter', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wpcom_json_api_attachment_cast_and_filter', 'filter_wpcom_json_api_attachment_cast_and_filter', 10, 1 ); 

Defined (2)

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

/class.json-api-endpoints.php  
  1. apply_filters( 'wpcom_json_api_attachment_cast_and_filter', $docs ), 
  1. apply_filters( 'wpcom_json_api_attachment_cast_and_filter', $docs ),