embed_maybe_make_link

Filters the returned, maybe-linked embed URL.

Description

apply_filters( 'embed_maybe_make_link', (string) $output, (string) $url ); 

Parameters (2)

0. $output (string)
The linked or original URL.
1. $url (string)
The original URL.

Usage

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

Defined (1)

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

/wp-includes/class-wp-embed.php  
  1. return apply_filters( 'embed_maybe_make_link', $output, $url );