Changeset 2908
- Timestamp:
- 04/06/2016 02:35:44 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r2755 r2908 290 290 * 291 291 * Note: nonce protected, only available to logged in users 292 * 293 * While this user search is a bit heavy because of the SQL to search the whole users table, 292 * 293 * While this user search is a bit heavy because of the SQL to search the whole users table, 294 294 * it's not one that we will actually run a lot. This only occurs when a theme directory admin 295 * is changing the "author" of a theme. This is fairly rare. If the query causes too many issues, 295 * is changing the "author" of a theme. This is fairly rare. If the query causes too many issues, 296 296 * then we can refine it to limit it more. 297 297 */ … … 307 307 ); 308 308 $user_query = new WP_User_Query( $args ); 309 309 310 310 if ( $user_query->results ) { 311 311 $resp = array(); … … 317 317 echo json_encode($resp); 318 318 } 319 exit; 319 exit; 320 320 } 321 321 add_action('wp_ajax_author-lookup', 'wporg_themes_author_lookup'); … … 994 994 995 995 /** 996 * Prints Open Graph meta data and meta tags for Twitter cards. 997 */ 998 function wporg_themes_add_meta_tags() { 999 if ( ! is_single() ) { 1000 return; 1001 } 1002 1003 $post = get_post(); 1004 if ( ! $post ) { 1005 return; 1006 } 1007 1008 $theme = wporg_themes_theme_information( $post->post_name ); 1009 if ( ! $theme ) { 1010 return; 1011 } 1012 1013 echo "<meta property='og:title' content='" . esc_attr( $theme->name ) . "' />\n"; 1014 echo "<meta property='og:description' content='" . esc_attr( $theme->description ) . "' />\n"; 1015 echo "<meta property='og:site_name' content='WordPress.org' />\n"; 1016 echo "<meta property='og:type' content='website' />\n"; 1017 echo "<meta property='og:url' content='" . esc_attr( get_permalink( $post->id ) ) . "' />\n"; 1018 1019 if ( $theme->screenshot_url ) { 1020 echo "<meta property='og:image' content='" . esc_attr( $theme->screenshot_url ) . "' />\n"; 1021 echo "<meta name='twitter:card' content='summary_large_image'>\n"; 1022 echo "<meta name='twitter:site' content='@WordPress'>\n"; 1023 echo "<meta name='twitter:image' content='" . esc_attr( $theme->screenshot_url . '?w=560&strip=all' ) . "' />\n"; 1024 } 1025 } 1026 add_action( 'wp_head', 'wporg_themes_add_meta_tags' ); 1027 1028 /** 996 1029 * Filter the URLs to use the current localized domain name, rather than WordPress.org. 997 1030 *
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)