Changeset 10351
- Timestamp:
- 10/06/2020 05:00:31 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 1 edited
- 1 moved
-
embed-repopackage.php (moved) (moved from sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/embed.php) (1 diff)
-
functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/embed-repopackage.php
r10350 r10351 27 27 <body <?php body_class(); ?>> 28 28 <?php 29 if ( have_posts() ) : 30 while ( have_posts() ) : the_post(); 31 // setup the theme variable 32 // note, $theme contains things like active installs and other data to be added eventually 33 $theme = wporg_themes_theme_information( $post->post_name ); 29 the_post(); 30 // setup the theme variable 31 // note, $theme contains things like active installs and other data to be added eventually 32 $theme = wporg_themes_theme_information( $post->post_name ); 33 ?> 34 <div <?php post_class( 'wp-embed' ); ?>> 35 <div class="wp-embed-featured-image rectangular"> 36 <a href="<?php the_permalink(); ?>" target="_top"> 37 <img src='<?php echo $theme->screenshot_url; ?>'> 38 </a> 39 </div> 34 40 41 <p class="wp-embed-heading"> 42 <a href="<?php the_permalink(); ?>" target="_top"> 43 <?php echo esc_html( $theme->name ); ?> 44 </a> 45 </p> 46 47 <div class="wp-embed-excerpt"><?php echo wp_trim_words( $theme->description, 55 ); ?></div> 48 49 <?php 50 /** 51 * Print additional content after the embed excerpt. 52 * 53 * @since 4.4.0 54 */ 55 do_action( 'embed_content' ); 35 56 ?> 36 <div <?php post_class( 'wp-embed' ); ?>>37 <div class="wp-embed-featured-image rectangular">38 <a href="<?php the_permalink(); ?>" target="_top">39 <img src='<?php echo $theme->screenshot_url; ?>'>40 </a>41 </div>42 57 43 <p class="wp-embed-heading"> 44 <a href="<?php the_permalink(); ?>" target="_top"> 45 <?php echo esc_html( $theme->name ); ?> 46 </a> 47 </p> 58 <div class="wp-embed-footer"> 59 <div class="wp-embed-site-title"> 60 <?php 61 $site_title = sprintf( 62 '<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>', 63 esc_url( home_url() ), 64 esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ), 65 esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ), 66 esc_html( get_bloginfo( 'name' ) ) 67 ); 48 68 49 <div class="wp-embed-excerpt"><?php echo wp_trim_words( $theme->description, 55 ); ?></div> 69 /** 70 * Filter the site title HTML in the embed footer. 71 * 72 * @since 4.4.0 73 * 74 * @param string $site_title The site title HTML. 75 */ 76 echo apply_filters( 'embed_site_title_html', $site_title ); 77 ?> 78 </div> 50 79 80 <div class="wp-embed-meta"> 51 81 <?php 52 82 /** 53 * Print additional content after the embed excerpt.83 * Print additional meta content in the embed template. 54 84 * 55 85 * @since 4.4.0 56 86 */ 57 do_action( 'embed_content ');87 do_action( 'embed_content_meta'); 58 88 ?> 59 60 <div class="wp-embed-footer">61 <div class="wp-embed-site-title">62 <?php63 $site_title = sprintf(64 '<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>',65 esc_url( home_url() ),66 esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),67 esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ),68 esc_html( get_bloginfo( 'name' ) )69 );70 71 /**72 * Filter the site title HTML in the embed footer.73 *74 * @since 4.4.075 *76 * @param string $site_title The site title HTML.77 */78 echo apply_filters( 'embed_site_title_html', $site_title );79 ?>80 </div>81 82 <div class="wp-embed-meta">83 <?php84 /**85 * Print additional meta content in the embed template.86 *87 * @since 4.4.088 */89 do_action( 'embed_content_meta');90 ?>91 </div>92 </div>93 </div>94 <?php95 endwhile;96 else :97 ?>98 <div class="wp-embed">99 <p class="wp-embed-heading"><?php _e( 'Oops! That embed can’t be found.' ); ?></p>100 101 <div class="wp-embed-excerpt">102 <p>103 <?php104 printf(105 /* translators: %s: a link to the embedded site */106 __( 'It looks like nothing was found at this location. Maybe try visiting %s directly?' ),107 '<strong><a href="' . esc_url( home_url() ) . '">' . esc_html( get_bloginfo( 'name' ) ) . '</a></strong>'108 );109 ?>110 </p>111 </div>112 113 <div class="wp-embed-footer">114 <div class="wp-embed-site-title">115 <?php116 $site_title = sprintf(117 '<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>',118 esc_url( home_url() ),119 esc_url( get_site_icon_url( 32, admin_url( 'images/w-logo-blue.png' ) ) ),120 esc_url( get_site_icon_url( 64, admin_url( 'images/w-logo-blue.png' ) ) ),121 esc_html( get_bloginfo( 'name' ) )122 );123 124 /** This filter is documented in wp-includes/embed-template.php */125 echo apply_filters( 'embed_site_title_html', $site_title );126 ?>127 </div>128 89 </div> 129 90 </div> 130 <?php 131 endif; 91 </div> 92 <?php 132 93 133 94 /** -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
r10330 r10351 432 432 } 433 433 434 /**435 * Override the embed template with our own for themes436 */437 function wporg_themes_embed_template( $template ) {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 445 return $template;446 }447 add_filter( 'embed_template', 'wporg_themes_embed_template' );448 449 434 include_once WP_CONTENT_DIR . '/plugins/jetpack/modules/seo-tools/jetpack-seo.php'; 450 435 include_once WP_CONTENT_DIR . '/plugins/jetpack/modules/seo-tools/jetpack-seo-posts.php';
Note: See TracChangeset
for help on using the changeset viewer.