xmlrpc_prepare_media_item

Filters XML-RPC-prepared data for the given media item.

Description

apply_filters( 'xmlrpc_prepare_media_item', (object) $media_item, (object) $media_item, (string) $thumbnail_size ); 

Parameters (3)

0. $media_item (array)
An array of media item data.
1. $media_item (object)
Media item object.
2. $thumbnail_size (string)
The thumbnail size.

Usage

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

Defined (1)

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

/wp-includes/class-wp-xmlrpc-server.php  
  1. return apply_filters( 'xmlrpc_prepare_media_item', $_media_item, $media_item, $thumbnail_size );