press_suggested_html

Filters the default HTML tags used in the suggested content for the editor.

Description

apply_filters( 'press_suggested_html', (array) $default_html, (array) $data ); 

The HTML strings use printf format. After filtering the content is added at the specified places with sprintf()..

Parameters (2)

0. $default_html (array)
Associative array with three possible keys: - quote where %1$s is replaced with the site description or the selected content. - link where %1$s is link href, %2$s is link text, usually the source page title. - embed which contains an [embed] shortcode when the source page offers embeddable content.
1. $data (array)
Associative array containing the data from the source page.

Usage

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

Defined (1)

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

/wp-admin/includes/class-wp-press-this.php  
  1. $default_html = apply_filters( 'press_this_suggested_html', $default_html, $data );