Changeset 9017
- Timestamp:
- 07/02/2019 05:56:38 AM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r9016 r9017 972 972 $post = get_post( $post_id ); 973 973 974 // Only translate Plugin post objects 974 // Only translate Plugin post objects. 975 975 if ( $post && 'plugin' === $post->post_type ) { 976 976 return Plugin_I18n::instance()->translate( $section, $content, [ 'post_id' => $post_id ] ); … … 990 990 $post = get_post( $post_id ); 991 991 992 // Only translate P ost type items.992 // Only translate Plugin post objects. 993 993 if ( $post && $post->post_type === 'plugin' ) { 994 994 return Plugin_I18n::instance()->translate( 'title', $title, [ 'post_id' => $post ] ); … … 1008 1008 $post = get_post( $post ); 1009 1009 1010 // Only translate P ost type items.1010 // Only translate Plugin post objects. 1011 1011 if ( $post && $post->post_type === 'plugin' ) { 1012 1012 return Plugin_I18n::instance()->translate( 'excerpt', $excerpt, [ 'post_id' => $post ] ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php
r8341 r9017 539 539 540 540 // Get the active language packs of the plugin. 541 $locales = $wpdb->get_col( $wpdb->prepare( " 542 SELECT `language` 543 FROM language_packs 544 WHERE 545 type = 'plugin' AND 546 domain = %s AND 547 active = 1 548 GROUP BY `language`", 549 $plugin_slug 550 ) ); 541 $locales = wp_cache_get( $plugin_slug, 'language-pack-locales' ); 542 if ( $locales === false ) { 543 $locales = $wpdb->get_col( $wpdb->prepare( " 544 SELECT `language` 545 FROM language_packs 546 WHERE 547 type = 'plugin' AND 548 domain = %s AND 549 active = 1 550 GROUP BY `language`", 551 $plugin_slug 552 ) ); 553 554 wp_cache_set( $plugin_slug, $locales, 'language-pack-locales', HOUR_IN_SECONDS ); 555 } 551 556 552 557 $translations = [];
Note: See TracChangeset
for help on using the changeset viewer.