Ticket #32096: 32096.4.diff
| File 32096.4.diff, 2.0 KB (added by , 7 years ago) |
|---|
-
src/wp-content/themes/twentyfifteen/functions.php
556 556 * @since Twenty Fifteen 1.0 557 557 */ 558 558 require get_template_directory() . '/inc/customizer.php'; 559 560 /** 561 * Prevents author-bio.php from being accessed directly if user_nicename is `bio` 562 * 563 * @since Twenty Fifteen 2.5 564 * 565 * @param string @template Template file 566 * @return string Replacement template file 567 */ 568 function twentyfifteen_author_bio_template( $template ) { 569 $author_posts_number = get_the_author_posts(); 570 571 if ( get_the_author_meta( 'user_nicename' ) === 'bio' || $author_posts_number === 0 ) { 572 $new_template = locate_template( array( 'archive.php' ) ); 573 574 if ( '' != $new_template ) { 575 return $new_template; 576 } 577 578 } 579 580 return $template; 581 } 582 add_filter( 'template_include', 'twentyfifteen_author_bio_template' ); -
src/wp-content/themes/twentythirteen/functions.php
777 777 return $args; 778 778 } 779 779 add_filter( 'widget_tag_cloud_args', 'twentythirteen_widget_tag_cloud_args' ); 780 781 /** 782 * Prevents author-bio.php from being accessed directly if user_nicename is `bio` 783 * 784 * @since Twenty Fifteen 2.9 785 * 786 * @param string @template Template file 787 * @return string Replacement template file 788 */ 789 function twentythirteen_author_bio_template( $template ) { 790 $author_posts_number = get_the_author_posts(); 791 792 if ( get_the_author_meta( 'user_nicename' ) === 'bio' || $author_posts_number === 0 ) { 793 $new_template = locate_template( array( 'archive.php' ) ); 794 795 if ( '' != $new_template ) { 796 return $new_template; 797 } 798 799 } 800 801 return $template; 802 } 803 add_filter( 'template_include', 'twentythirteen_author_bio_template' );