Ticket #32096: 32096.5.diff
| File 32096.5.diff, 2.0 KB (added by , 7 years ago) |
|---|
-
src/wp-content/themes/twentyfifteen/functions.php
535 535 } 536 536 add_filter( 'widget_tag_cloud_args', 'twentyfifteen_widget_tag_cloud_args' ); 537 537 538 /** 539 * Prevents author-bio.php from being accessed directly if user_nicename is `bio` 540 * 541 * @since Twenty Fifteen 2.5 542 * 543 * @param string @template Template file 544 * @return string Replacement template file 545 */ 546 function twentyfifteen_author_bio_template( $template ) { 547 $author_posts_number = get_the_author_posts(); 548 549 if ( get_the_author_meta( 'user_nicename' ) === 'bio' || $author_posts_number === 0 ) { 550 $new_template = locate_template( array( 'archive.php' ) ); 551 552 if ( '' != $new_template ) { 553 return $new_template; 554 } 555 556 } 557 558 return $template; 559 } 560 add_filter( 'template_include', 'twentyfifteen_author_bio_template' ); 561 538 562 539 563 /** 540 564 * Implement the Custom Header feature. -
src/wp-content/themes/twentythirteen/functions.php
796 796 do_action( 'wp_body_open' ); 797 797 } 798 798 endif; 799 800 /** 801 * Prevents author-bio.php from being accessed directly if user_nicename is `bio` 802 * 803 * @since Twenty Thirteen 2.9 804 * 805 * @param string @template Template file 806 * @return string Replacement template file 807 */ 808 function twentythirteen_author_bio_template( $template ) { 809 $author_posts_number = get_the_author_posts(); 810 811 if ( get_the_author_meta( 'user_nicename' ) === 'bio' || $author_posts_number === 0 ) { 812 $new_template = locate_template( array( 'archive.php' ) ); 813 814 if ( '' != $new_template ) { 815 return $new_template; 816 } 817 818 } 819 820 return $template; 821 } 822 add_filter( 'template_include', 'twentythirteen_author_bio_template' );