Changeset 10447 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php
- Timestamp:
- 11/12/2020 06:49:51 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-i18n.php
r10446 r10447 250 250 251 251 return $translation_set_id; 252 }253 254 /**255 * Searches GlotPress "originals" for the passed string.256 *257 * @param string $slug Plugin slug258 * @param string $branch dev|stable259 * @param string $key Unique key260 * @param string $str String to be searched for261 * @return bool|mixed|null262 */263 public function search_gp_original( $slug, $branch, $key, $str ) {264 global $wpdb;265 266 $cache_suffix = "original:{$key}";267 268 if ( false !== ( $original = $this->cache_get( $slug, $branch, $cache_suffix ) ) ) {269 return $original;270 }271 272 $branch_id = $this->get_gp_branch_id( $slug, $branch );273 274 if ( empty( $branch_id ) ) {275 return false;276 }277 278 $original = $wpdb->get_row( $wpdb->prepare(279 'SELECT id, singular, comment FROM ' . GLOTPRESS_TABLE_PREFIX . 'originals WHERE project_id = %d AND status = %s AND singular = %s',280 $branch_id, '+active', $str281 ) );282 283 if ( empty( $original ) ) {284 $original = null;285 }286 287 $this->cache_set( $slug, $branch, $original, $cache_suffix );288 289 return $original;290 252 } 291 253
Note: See TracChangeset
for help on using the changeset viewer.