Make WordPress Core


Ignore:
Timestamp:
02/24/2016 08:56:18 PM (10 years ago)
Author:
DrewAPicture
Message:

Embeds: Introduce embed templates into the template hierarchy via theme-compat.

Splits wp-includes/embed-template.php, introduced in 4.4, into five new templates that can be individually overridden by themes:

  • embed.php
  • embed-404.php
  • embed-content.php
  • header-embed.php
  • footer-embed.php

Also introduces a new template tag for outputting the site title, the_embed_site_title().

The five new templates live in theme-compat, allowing for graceful fallbacks should themes prefer not to override any or all of them.

Props swissspidy, imath, ocean90, DrewAPicture.
See #34561.

File:
1 edited

Legend:

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

    r36307 r36693  
    10471047    <?php
    10481048}
     1049
     1050/**
     1051 * Prints the necessary markup for the site title.
     1052 *
     1053 * @since 4.5.0
     1054 */
     1055function the_embed_site_title() {
     1056    $site_title = sprintf(
     1057        '<a href="%s" target="_top"><img src="%s" srcset="%s 2x" width="32" height="32" alt="" class="wp-embed-site-icon"/><span>%s</span></a>',
     1058        esc_url( home_url() ),
     1059        esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),
     1060        esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ),
     1061        esc_html( get_bloginfo( 'name' ) )
     1062    );
     1063
     1064    $site_title = '<div class="wp-embed-site-title">' . $site_title . '</div>';
     1065
     1066    /**
     1067     * Filter the site title HTML in the embed footer.
     1068     *
     1069     * @since 4.4.0
     1070     *
     1071     * @param string $site_title The site title HTML.
     1072     */
     1073    echo apply_filters( 'embed_site_title_html', $site_title );
     1074}
Note: See TracChangeset for help on using the changeset viewer.