Changeset 4505 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
- Timestamp:
- 12/08/2016 01:58:37 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php
r4504 r4505 164 164 } 165 165 166 $post_id = get_the_ID(); 167 $banner = Template::get_plugin_banner( $post_id ); 166 $banner = Template::get_plugin_banner(); 168 167 $banner['banner_2x'] = $banner['banner_2x'] ? $banner['banner'] : false; 169 $icon = Template::get_plugin_icon( $post_id);170 171 printf( '<meta property="og:title" content="%s" />' . "\n", the_title_attribute( array( 'echo' => false , 'post' => $post_id) ) );172 printf( '<meta property="og:description" content="%s" />' . "\n", esc_attr( strip_tags( get_the_excerpt( $post_id) ) ) );168 $icon = Template::get_plugin_icon(); 169 170 printf( '<meta property="og:title" content="%s" />' . "\n", the_title_attribute( array( 'echo' => false ) ) ); 171 printf( '<meta property="og:description" content="%s" />' . "\n", esc_attr( strip_tags( get_the_excerpt() ) ) ); 173 172 printf( '<meta property="og:site_name" content="WordPress.org" />' . "\n" ); 174 173 printf( '<meta property="og:type" content="website" />' . "\n" ); 175 printf( '<meta property="og:url" content="%s" />' . "\n", esc_url( get_permalink( $post_id) ) );174 printf( '<meta property="og:url" content="%s" />' . "\n", esc_url( get_permalink() ) ); 176 175 printf( '<meta name="twitter:card" content="summary_large_image">' . "\n" ); 177 176 printf( '<meta name="twitter:site" content="@WordPress">' . "\n" ); 178 177 179 178 if ( $banner['banner_2x'] ) { 180 printf( '<meta name="twitter:image" content="%s" />' . "\n", $banner['banner_2x']);179 printf( '<meta name="twitter:image" content="%s" />' . "\n", esc_url( $banner['banner_2x'] ) ); 181 180 } 182 181 if ( isset( $banner['banner'] ) ) { 183 printf( '<meta property="og:image" content="%s" />' . "\n", $banner['banner']);182 printf( '<meta property="og:image" content="%s" />' . "\n", esc_url( $banner['banner'] ) ); 184 183 } 185 184 if ( ! $icon['generated'] && ( $icon['icon_2x'] || $icon['icon'] ) ) { 186 printf( '<meta name="thumbnail" content="%s" />' , $icon['icon_2x'] ?: $icon['icon']);185 printf( '<meta name="thumbnail" content="%s" />' . "\n", esc_url( $icon['icon_2x'] ?: $icon['icon'] ) ); 187 186 } 188 187 }
Note: See TracChangeset
for help on using the changeset viewer.