Making WordPress.org


Ignore:
Timestamp:
10/01/2020 03:23:22 AM (5 years ago)
Author:
dd32
Message:

Theme Directory: Only have our custom embed handler assigned for Theme post types, rather than for all resources (Such as the info pages).

Fixes invalid embed previews for pages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r10034 r10330  
    433433
    434434/**
    435  * Override the embed template with our own
     435 * Override the embed template with our own for themes
    436436 */
    437437function wporg_themes_embed_template( $template ) {
    438     $theme_embed_template = locate_template( 'embed.php' );
    439     if ( $theme_embed_template ) {
    440         return $theme_embed_template;
    441     }
     438    if ( 'repopackage' === get_post_type() ) {
     439        $theme_embed_template = locate_template( 'embed.php' );
     440        if ( $theme_embed_template ) {
     441            $template = $theme_embed_template;
     442        }
     443    }
     444
    442445    return $template;
    443446}
Note: See TracChangeset for help on using the changeset viewer.