wp/wp-includes/sitemaps/class-wp-sitemaps.php
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    73 		}
    73 		}
    74 
    74 
    75 		$this->register_sitemaps();
    75 		$this->register_sitemaps();
    76 
    76 
    77 		// Add additional action callbacks.
    77 		// Add additional action callbacks.
    78 		add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
       
    79 		add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
    78 		add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
    80 	}
    79 	}
    81 
    80 
    82 	/**
    81 	/**
    83 	 * Determines whether sitemaps are enabled or not.
    82 	 * Determines whether sitemaps are enabled or not.
   221 
   220 
   222 	/**
   221 	/**
   223 	 * Redirects a URL to the wp-sitemap.xml
   222 	 * Redirects a URL to the wp-sitemap.xml
   224 	 *
   223 	 *
   225 	 * @since 5.5.0
   224 	 * @since 5.5.0
       
   225 	 * @deprecated 6.7.0 Deprecated in favor of {@see WP_Rewrite::rewrite_rules()}
   226 	 *
   226 	 *
   227 	 * @param bool     $bypass Pass-through of the pre_handle_404 filter value.
   227 	 * @param bool     $bypass Pass-through of the pre_handle_404 filter value.
   228 	 * @param WP_Query $query  The WP_Query object.
   228 	 * @param WP_Query $query  The WP_Query object.
   229 	 * @return bool Bypass value.
   229 	 * @return bool Bypass value.
   230 	 */
   230 	 */
   231 	public function redirect_sitemapxml( $bypass, $query ) {
   231 	public function redirect_sitemapxml( $bypass, $query ) {
       
   232 		_deprecated_function( __FUNCTION__, '6.7.0' );
       
   233 
   232 		// If a plugin has already utilized the pre_handle_404 function, return without action to avoid conflicts.
   234 		// If a plugin has already utilized the pre_handle_404 function, return without action to avoid conflicts.
   233 		if ( $bypass ) {
   235 		if ( $bypass ) {
   234 			return $bypass;
   236 			return $bypass;
   235 		}
   237 		}
   236 
   238