- Timestamp:
- 03/07/2019 11:29:31 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/jobs.wordpress.net/public_html/wp-content/plugins/jobswp/jobswp.php
r8408 r8409 119 119 add_filter( 'posts_request', array( $this, 'admin_search_job_posts_request' ), 10, 2 ); 120 120 121 foreach ( array( 'the_content', 'the_title', 'single_post_title' ) as $filter ) 122 add_filter( $filter, array( $this, 'WordPress_dangit' ) ); 121 foreach ( [ 'the_content', 'the_title', 'single_post_title' ] as $filter ) { 122 add_filter( $filter, array( $this, 'proper_project_names_dangit' ) ); 123 } 123 124 124 125 add_action( 'save_post_job', array( $this, 'email_job_poster' ), 10, 3 ); … … 497 498 498 499 /** 499 * Replaces all malformed attempts at "WordPress" with "WordPress". 500 * Replaces all malformed attempts at "WordPress", "BuddyPress", and "bbPress" 501 * project names with proper spelling of the names. 500 502 * 501 503 * This is a bit broad-stroked for general use, but should be sufficient for job postings. 502 504 * 503 * @param string $text Text to process for malformed "WordPress" usage505 * @param string $text Text to process for malformed project names. 504 506 * @return string The fixed text 505 507 */ 506 public function WordPress_dangit( $text ) {507 returnstr_replace(508 array( 'Wordpress', 'wordpress', 'wordPress', 'word press', 'Word press', 'word Press', 'Word Press' ),508 public function proper_project_names_dangit( $text ) { 509 $text = str_replace( 510 [ 'Wordpress', 'wordpress', 'wordPress', 'word press', 'Word press', 'word Press', 'Word Press' ], 509 511 'WordPress', 510 512 $text 511 513 ); 514 515 $text = str_replace( 516 [ 'Buddypress', 'buddypress', 'buddyPress', 'buddy press', 'Buddy press', 'buddy Press', 'Buddy Press' ], 517 'BuddyPress', 518 $text 519 ); 520 521 $text = str_replace( 522 [ 'Bbpress', 'BBpress', 'BBPress', 'BbPress', 'bbpress', 'bb press', 'Bb press', 'bb Press', 'BB press', 'BB Press' ], 523 'bbPress', 524 $text 525 ); 526 512 527 return $text; 513 528 }
Note: See TracChangeset
for help on using the changeset viewer.