wp_prepare_attachment_for_js

Filters the attachment data prepared for JavaScript.

Description

add_filter( 'wp_prepare_attachment_for_js', (string) $videopress_prepare_attachment_for_js ); 

Parameters (1)

0. $videopress_prepare_attachment_for_js (string) => 'videopress_prepare_attachment_for_js'
The videopress prepare attachment for js.

Usage

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

Defined (1)

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

/modules/videopress/editor-media-view.php  
  1. add_filter( 'wp_prepare_attachment_for_js', 'videopress_prepare_attachment_for_js' );