Changeset 20027 for trunk/wp-admin/includes/class-wp-themes-list-table.php
- Timestamp:
- 02/28/2012 08:51:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-themes-list-table.php
r20026 r20027 191 191 192 192 function search_theme( $theme ) { 193 $matched = 0; 193 // Search the features 194 if ( $this->features ) { 195 foreach ( $this->features as $word ) { 196 if ( ! in_array( $word, $theme['Tags'] ) ) 197 return false; 198 } 199 } 194 200 195 201 // Match all phrases 196 if ( count( $this->search ) > 0) {202 if ( $this->search ) { 197 203 foreach ( $this->search as $word ) { 198 $matched = 0;199 200 // In a tag?201 204 if ( in_array( $word, $theme['Tags'] ) ) 202 $matched = 1; 203 204 // In one of the fields? 205 foreach ( array( 'Name', 'Title', 'Description', 'Author', 'Template', 'Stylesheet' ) AS $field ) { 206 if ( stripos( $theme[$field], $word ) !== false ) 207 $matched++; 208 } 209 210 if ( $matched == 0 ) 211 return false; 212 } 213 } 214 215 // Now search the features 216 if ( count( $this->features ) > 0 ) { 217 foreach ( $this->features as $word ) { 218 // In a tag? 219 if ( !in_array( $word, $theme['Tags'] ) ) 220 return false; 221 } 222 } 223 224 // Only get here if each word exists in the tags or one of the fields 205 continue; 206 } 207 208 foreach ( array( 'Name', 'Title', 'Description', 'Author', 'Template', 'Stylesheet' ) as $header ) { 209 if ( false !== stripos( $theme[ $header ], $word ) ) 210 continue 2; 211 } 212 213 return false; 214 } 215 225 216 return true; 226 217 }
Note: See TracChangeset
for help on using the changeset viewer.