| | 531 | * Output social metadata |
| | 532 | */ |
| | 533 | public function social_meta_data() { |
| | 534 | if ( ! is_singular( 'plugin' ) ) { |
| | 535 | return; |
| | 536 | } |
| | 537 | |
| | 538 | $post_id = get_the_ID(); |
| | 539 | $banner = Template::get_plugin_banner( $post_id, 'raw' ); |
| | 540 | $icon = Template::get_plugin_icon( $post_id, 'raw' ); |
| | 541 | |
| | 542 | printf( '<meta property="og:title" content="%s" />', get_the_title( $post_id ) ); |
| | 543 | printf( '<meta property="og:description" content="%s" />', get_the_excerpt( $post_id ) ); |
| | 544 | printf( '<meta property="og:site_name" content="WordPress.org" />' ); |
| | 545 | printf( '<meta property="og:type" content="website" />' ); |
| | 546 | printf( '<meta property="og:url" content="%s" />', esc_url( get_permalink( $post_id ) ) ); |
| | 547 | printf( '<meta name="twitter:card" content="summary_large_image">' ); |
| | 548 | printf( '<meta name="twitter:site" content="@WordPress">' ); |
| | 549 | printf( '<meta name="twitter:image" content="%s" />', $banner['banner_2x'] ); |
| | 550 | printf( '<meta property="og:image" content="%s" />', $banner['banner'] ); |
| | 551 | printf( '<meta name="thumbnail" content="%s" />', $icon['icon_2x'] ); |
| | 552 | } |
| | 553 | |
| | 554 | /** |