Changeset 34492 for trunk/src/wp-includes/class-wp.php
- Timestamp:
- 09/24/2015 02:03:05 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp.php
r34476 r34492 588 588 */ 589 589 public function handle_404() { 590 global $wp_query ;590 global $wp_query, $wp; 591 591 592 592 // If we've already issued a 404, bail. … … 597 597 if ( is_admin() || is_robots() || $wp_query->posts ) { 598 598 599 // Only set X-Pingback for single posts.599 $success = true; 600 600 if ( is_singular() ) { 601 601 $p = clone $wp_query->post; 602 // Only set X-Pingback for single posts that allow pings. 602 603 if ( $p && pings_open( $p ) ) { 603 604 @header( 'X-Pingback: ' . get_bloginfo( 'pingback_url' ) ); 604 605 } 605 } 606 607 status_header( 200 ); 608 return; 606 607 // check for paged content that exceeds the max number of pages 608 $next = '<!--nextpage-->'; 609 if ( $p && false !== strpos( $p->post_content, $next ) && ! empty( $wp->query_vars['page'] ) ) { 610 $page = trim( $wp->query_vars['page'], '/' ); 611 $success = (int) $page <= ( substr_count( $p->post_content, $next ) + 1 ); 612 } 613 } 614 615 if ( $success ) { 616 status_header( 200 ); 617 return; 618 } 609 619 } 610 620
Note: See TracChangeset
for help on using the changeset viewer.