Changeset 4372
- Timestamp:
- 11/17/2016 05:07:55 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r4337 r4372 49 49 add_filter( 'query_vars', array( $this, 'filter_query_vars' ) ); 50 50 add_filter( 'single_term_title', array( $this, 'filter_single_term_title' ) ); 51 add_filter( 'the_content', array( $this, 'filter_rel_nofollow' ) ); 51 52 52 53 // oEmbed whitlisting. … … 475 476 476 477 return $term_link; 478 } 479 480 /** 481 * Filter content to make links rel=nofollow on plugin pages only 482 * @param string $content The content. 483 * @return string 484 */ 485 public function filter_rel_nofollow( $content ) { 486 if ( get_post_type() == 'plugin' ) 487 // regex copied from wp_rel_nofollow(). Not calling that function because it messes with slashes. 488 $content = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $content); 489 return $content; 477 490 } 478 491
Note: See TracChangeset
for help on using the changeset viewer.