Ticket #18548: 18548.3.diff
File 18548.3.diff, 2.9 KB (added by , 10 years ago) |
---|
-
src/wp-includes/default-filters.php
196 196 add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 ); 197 197 198 198 // Actions 199 add_action( 'wp_head', '_wp_render_title_tag', 1 ); 199 200 add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); 200 201 add_action( 'wp_head', 'feed_links', 2 ); 201 202 add_action( 'wp_head', 'feed_links_extra', 3 ); -
src/wp-includes/general-template.php
731 731 } 732 732 733 733 /** 734 * Display <title> tag with contents. 735 * 736 * @since 4.1.0 737 * @access private 738 */ 739 function _wp_render_title_tag() { 740 if ( ! current_theme_supports( 'title-tag' ) ) { 741 return; 742 } 743 744 // This can only work internally on wp_head. 745 if ( ! did_action( 'wp_head' ) && ( ! function_exists( 'doing_action' ) || ! doing_action( 'wp_head' ) ) ) { 746 return; 747 } 748 749 $sep = '|'; 750 $title = wp_title( $sep, false, 'right' ); 751 752 if ( ! is_feed() ) { 753 global $page, $paged; 754 755 // Add the blog name 756 $title .= get_bloginfo( 'name', 'display' ); 757 758 // Add the blog description for the home/front page. 759 $site_description = get_bloginfo( 'description', 'display' ); 760 if ( $site_description && ( is_home() || is_front_page() ) ) { 761 $title .= " $sep $site_description"; 762 } 763 764 // Add a page number if necessary: 765 if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { 766 $title .= " $sep " . sprintf( esc_html__( 'Page %s' ), max( $paged, $page ) ); 767 } 768 } 769 770 echo "<title>$title</title>\n"; 771 } 772 773 /** 734 774 * Display or retrieve page title for all areas of blog. 735 775 * 736 776 * By default, the page title will display the separator before the page title, -
src/wp-includes/theme.php
1607 1607 define( 'BACKGROUND_IMAGE', $args[0]['default-image'] ); 1608 1608 1609 1609 break; 1610 // ensure that 'title-tag' is accessible in the admin. 1611 1612 case 'title-tag' : 1613 if ( function_exists( 'doing_action' ) 1614 && ! doing_action( 'after_setup_theme' ) // can be called here 1615 && ! doing_action( 'init' ) // can also be called here 1616 && ( doing_action() || did_action( 'wp_loaded' ) ) // can be called in functions.php but must happen before wp_loaded, i.e. not in header.php 1617 ) { 1618 _doing_it_wrong( "add_theme_support( 'title-tag' )", __( "You need to add support before 'wp_loaded'." ), '4.1.0' ); 1619 } 1620 break; 1610 1621 } 1611 1622 1612 1623 $_wp_theme_features[ $feature ] = $args;