Make WordPress Core

Ticket #39703: signup-activate-2.patch

File signup-activate-2.patch, 4.9 KB (added by imath, 8 years ago)
  • src/wp-activate.php

    diff --git src/wp-activate.php src/wp-activate.php
    index b13279a..412421d 100644
    define( 'WP_INSTALLING', true ); 
    1111/** Sets up the WordPress Environment. */
    1212require( dirname(__FILE__) . '/wp-load.php' );
    1313
    14 require( dirname( __FILE__ ) . '/wp-blog-header.php' );
     14wp( array(
     15        'pre_query_page' => 'wp-activate',
     16) );
     17
     18require( ABSPATH . WPINC . '/template-loader.php' );
    1519
    1620if ( !is_multisite() ) {
    1721        wp_redirect( wp_registration_url() );
    if ( !is_multisite() ) { 
    2125if ( is_object( $wp_object_cache ) )
    2226        $wp_object_cache->cache_enabled = false;
    2327
    24 // Fix for page title
    25 $wp_query->is_404 = false;
    26 
    2728/**
    2829 * Fires before the Site Activation page is loaded.
    2930 *
    add_action( 'wp_head', 'do_activate_header' ); 
    5859function wpmu_activate_stylesheet() {
    5960        ?>
    6061        <style type="text/css">
     62                #signup-content { width: 90%; margin:0 auto; }
    6163                form { margin-top: 2em; }
    62                 #submit, #key { width: 90%; font-size: 24px; }
     64                #submit, #key { width: 100%; font-size: 24px; }
    6365                #language { margin-top: .5em; }
    6466                .error { background: #f66; }
    6567                span.h3 { padding: 0 8px; font-size: 1.3em; font-weight: bold; }
  • src/wp-includes/class-wp-query.php

    diff --git src/wp-includes/class-wp-query.php src/wp-includes/class-wp-query.php
    index eb68f21..5ef7688 100644
    class WP_Query { 
    610610                        , 'fields'
    611611                        , 'menu_order'
    612612                        , 'embed'
     613                        , 'pre_query_page'
    613614                );
    614615
    615616                foreach ( $keys as $key ) {
    class WP_Query { 
    16541655        }
    16551656
    16561657        /**
     1658         * Retrieve the posts for the Multisite signup and activate pages.
     1659         *
     1660         * @access public
     1661         *
     1662         * @return array List of posts.
     1663         */
     1664        public function posts_pre_query() {
     1665                $pre_query_page = $this->get( 'pre_query_page' );
     1666
     1667                if ( ! $pre_query_page ) {
     1668                        return null;
     1669                }
     1670
     1671                $pre_query_pages = array(
     1672                        'wp-signup'   => __( 'Register' ),
     1673                        'wp-activate' => __( 'Activate' ),
     1674                );
     1675
     1676                if ( ! isset( $pre_query_pages[ $pre_query_page ] ) ) {
     1677                        return null;
     1678                }
     1679
     1680                $post = new stdClass;
     1681                $post->ID         = 0;
     1682                $post->post_name  = $pre_query_page;
     1683                $post->post_title = $pre_query_pages[ $pre_query_page ];
     1684
     1685                // Set the queried object to avoid notices.
     1686                $this->queried_object    = get_post( $post );
     1687                $this->queried_object_id = $post->ID;
     1688
     1689                // Reset query flags
     1690                $this->init_query_flags();
     1691                $this->is_singular = true;
     1692
     1693                // Return the posts.
     1694                return array( $post );
     1695        }
     1696
     1697        /**
    16571698         * Retrieve the posts based on query variables.
    16581699         *
    16591700         * There are a few filters and actions that can be used to modify the post
    class WP_Query { 
    27702811                 *                          or null to allow WP to run its normal queries.
    27712812                 * @param WP_Query   $this  The WP_Query instance, passed by reference.
    27722813                 */
    2773                 $this->posts = apply_filters_ref_array( 'posts_pre_query', array( null, &$this ) );
     2814                $this->posts = apply_filters_ref_array( 'posts_pre_query', array( $this->posts_pre_query(), &$this ) );
    27742815
    27752816                if ( 'ids' == $q['fields'] ) {
    27762817                        if ( null === $this->posts ) {
  • src/wp-includes/class-wp.php

    diff --git src/wp-includes/class-wp.php src/wp-includes/class-wp.php
    index c62d790..13ce3ce 100644
    class WP { 
    2626         * @access public
    2727         * @var array
    2828         */
    29         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' );
     29        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' );
    3030
    3131        /**
    3232         * Extra query variables set by the user.
  • src/wp-signup.php

    diff --git src/wp-signup.php src/wp-signup.php
    index 156de61..742239f 100644
    require( dirname(__FILE__) . '/wp-load.php' ); 
    55
    66add_action( 'wp_head', 'wp_no_robots' );
    77
    8 require( dirname( __FILE__ ) . '/wp-blog-header.php' );
     8wp( array(
     9        'pre_query_page' => 'wp-signup',
     10) );
     11
     12require( ABSPATH . WPINC . '/template-loader.php' );
    913
    1014if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) {
    1115        wp_redirect( network_home_url() );
    if ( !is_main_site() ) { 
    3741        die();
    3842}
    3943
    40 // Fix for page title
    41 $wp_query->is_404 = false;
    42 
    4344/**
    4445 * Fires before the Site Signup page is loaded.
    4546 *