Changeset 13443 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
- Timestamp:
- 04/03/2024 07:01:21 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
r13292 r13443 308 308 $this->tags = array_map( 'trim', $this->tags ); 309 309 $this->tags = array_filter( $this->tags ); 310 310 311 if ( array_intersect( $this->tags, $this->ignore_tags ) ) { 311 312 $this->tags = array_diff( $this->tags, $this->ignore_tags ); … … 313 314 } 314 315 315 // Check if the tags are low-quality (ie. little used)316 if ( $this->tags && taxonomy_exists( 'plugin_tags' ) ) {317 $tags = get_terms( array(318 'taxonomy' => 'plugin_tags',319 'name' => $this->tags,320 ) );321 322 $low_usage_tags = array_filter(323 $tags,324 function( $term ) {325 return $term->count < 5;326 }327 );328 329 $this->warnings['low_usage_tags'] = wp_list_pluck( $low_usage_tags, 'name' );330 }331 332 316 if ( count( $this->tags ) > 5 ) { 317 $this->warnings['too_many_tags'] = array_slice( $this->tags, 4 ); 333 318 $this->tags = array_slice( $this->tags, 0, 5 ); 334 $this->warnings['too_many_tags'] = true;335 319 } 336 320 } … … 715 699 // In the event that something invalid is used, we'll ignore it (Example: 'Joe Bloggs (Australian Translation)') 716 700 if ( ! $user ) { 701 $this->warnings['contributor_ignored'] ??= []; 702 $this->warnings['contributor_ignored'][] = $name; 717 703 unset( $users[ $i ] ); 718 $this->warnings['contributor_ignored'] = true;719 704 continue; 720 705 } … … 723 708 $users[ $i ] = $user->user_nicename; 724 709 } 725 726 710 return $users; 727 711 }
Note: See TracChangeset
for help on using the changeset viewer.