Make WordPress Core


Ignore:
Timestamp:
08/20/2014 07:31:46 PM (12 years ago)
Author:
SergeyBiryukov
Message:

Don't limit WP_Embed::cache_oembed() to posts and pages.

props bordoni, helen.
fixes #28639.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-embed.php

    r29455 r29557  
    294294                $post = get_post( $post_ID );
    295295
    296                 $post_types = array( 'post', 'page' );
     296                $post_types = get_post_types( array( 'show_ui' => true ) );
    297297                /**
    298298                 * Filter the array of post types to cache oEmbed results for.
     
    300300                 * @since 2.9.0
    301301                 *
    302                  * @param array $post_types Array of post types to cache oEmbed results for. Default 'post', 'page'.
     302                 * @param array $post_types Array of post types to cache oEmbed results for. Defaults to post types with `show_ui` set to true.
    303303                 */
    304                 if ( empty($post->ID) || !in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ) ) )
     304                if ( empty( $post->ID ) || ! in_array( $post->post_type, apply_filters( 'embed_cache_oembed_types', $post_types ) ) ){
    305305                        return;
     306                }
    306307
    307308                // Trigger a caching
    308                 if ( !empty($post->post_content) ) {
     309                if ( ! empty( $post->post_content ) ) {
    309310                        $this->post_ID = $post->ID;
    310311                        $this->usecache = false;
Note: See TracChangeset for help on using the changeset viewer.