embed_cache_oembed_types

The WordPress Core embed cache oembed types hook.

Description

apply_filters( 'embed_cache_oembed_types', (unknown) $post_types ); 

Parameters (1)

0. $post_types (unknown)
The post types.

Usage

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

Defined (1)

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

/wp-includes/class-wp-embed.php  
  1. if ( empty( $post->ID ) || ! in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ) ) ) {