Make WordPress Core

Ticket #39703: 39703.2.patch

File 39703.2.patch, 4.8 KB (added by sabernhardt, 15 months ago)
  • src/wp-activate.php

     
    1111/** Sets up the WordPress Environment. */
    1212require __DIR__ . '/wp-load.php';
    1313
    14 require __DIR__ . '/wp-blog-header.php';
     14wp( array(
     15        'pre_query_page' => 'wp-activate',
     16) );
    1517
     18require ABSPATH . WPINC . '/template-loader.php';
     19
    1620if ( ! is_multisite() ) {
    1721        wp_redirect( wp_registration_url() );
    1822        die();
     
    6872        $wp_object_cache->cache_enabled = false;
    6973}
    7074
    71 // Fix for page title.
    72 $wp_query->is_404 = false;
    73 
    7475/**
    7576 * Fires before the Site Activation page is loaded.
    7677 *
     
    105106function wpmu_activate_stylesheet() {
    106107        ?>
    107108        <style type="text/css">
     109                #signup-content { width: 90%; margin:0 auto; }
    108110                form { margin-top: 2em; }
    109                 #submit, #key { width: 90%; font-size: 24px; }
     111                #submit, #key { width: 100%; font-size: 24px; }
    110112                #language { margin-top: .5em; }
    111113                .error { background: #f66; }
    112114                span.h3 { padding: 0 8px; font-size: 1.3em; font-weight: 600; }
  • src/wp-includes/class-wp-query.php

     
    577577                        'fields',
    578578                        'menu_order',
    579579                        'embed',
     580                        'pre_query_page',
    580581                );
    581582
    582583                foreach ( $keys as $key ) {
     
    17771778        }
    17781779
    17791780        /**
     1781         * Retrieves the posts for the Multisite signup and activate pages.
     1782         *
     1783         * @access public
     1784         *
     1785         * @return array List of posts.
     1786         */
     1787        public function posts_pre_query() {
     1788                $pre_query_page = $this->get( 'pre_query_page' );
     1789
     1790                if ( ! $pre_query_page ) {
     1791                        return null;
     1792                }
     1793
     1794                $pre_query_pages = array(
     1795                        'wp-signup'   => __( 'Register' ),
     1796                        'wp-activate' => __( 'Activate' ),
     1797                );
     1798
     1799                if ( ! isset( $pre_query_pages[ $pre_query_page ] ) ) {
     1800                        return null;
     1801                }
     1802
     1803                $post = new stdClass;
     1804                $post->ID         = 0;
     1805                $post->post_name  = $pre_query_page;
     1806                $post->post_title = $pre_query_pages[ $pre_query_page ];
     1807
     1808                // Set the queried object to avoid notices.
     1809                $this->queried_object    = get_post( $post );
     1810                $this->queried_object_id = $post->ID;
     1811
     1812                // Reset query flags.
     1813                $this->init_query_flags();
     1814                $this->is_singular = true;
     1815
     1816                // Return the posts.
     1817                return array( $post );
     1818        }
     1819
     1820        /**
    17801821         * Retrieves an array of posts based on query variables.
    17811822         *
    17821823         * There are a few filters and actions that can be used to modify the post
     
    30583099                 *                                    or null to allow WP to run its normal queries.
    30593100                 * @param WP_Query             $query The WP_Query instance (passed by reference).
    30603101                 */
    3061                 $this->posts = apply_filters_ref_array( 'posts_pre_query', array( null, &$this ) );
     3102                $this->posts = apply_filters_ref_array( 'posts_pre_query', array( $this->posts_pre_query(), &$this ) );
    30623103
    30633104                if ( 'ids' === $q['fields'] ) {
    30643105                        if ( null === $this->posts ) {
  • src/wp-includes/class-wp.php

     
    2424         * @since 2.0.0
    2525         * @var string[]
    2626         */
    27         public $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent', 'post_parent__in', 'post_parent__not_in', 'title', 'fields' );
     27        public $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent', 'post_parent__in', 'post_parent__not_in', 'title', 'fields', 'pre_query_page' );
    2828
    2929        /**
    3030         * Extra query variables set by the user.
  • src/wp-signup.php

     
    55
    66add_filter( 'wp_robots', 'wp_robots_no_robots' );
    77
    8 require __DIR__ . '/wp-blog-header.php';
     8wp( array(
     9        'pre_query_page' => 'wp-signup',
     10) );
    911
     12require ABSPATH . WPINC . '/template-loader.php';
     13
    1014nocache_headers();
    1115
    1216if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new'], get_site_option( 'illegal_names' ), true ) ) {
     
    3943        die();
    4044}
    4145
    42 // Fix for page title.
    43 $wp_query->is_404 = false;
    44 
    4546/**
    4647 * Fires before the Site Sign-up page is loaded.
    4748 *