Ticket #39703: signup-activate-2.patch
File signup-activate-2.patch, 4.9 KB (added by , 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 ); 11 11 /** Sets up the WordPress Environment. */ 12 12 require( dirname(__FILE__) . '/wp-load.php' ); 13 13 14 require( dirname( __FILE__ ) . '/wp-blog-header.php' ); 14 wp( array( 15 'pre_query_page' => 'wp-activate', 16 ) ); 17 18 require( ABSPATH . WPINC . '/template-loader.php' ); 15 19 16 20 if ( !is_multisite() ) { 17 21 wp_redirect( wp_registration_url() ); … … if ( !is_multisite() ) { 21 25 if ( is_object( $wp_object_cache ) ) 22 26 $wp_object_cache->cache_enabled = false; 23 27 24 // Fix for page title25 $wp_query->is_404 = false;26 27 28 /** 28 29 * Fires before the Site Activation page is loaded. 29 30 * … … add_action( 'wp_head', 'do_activate_header' ); 58 59 function wpmu_activate_stylesheet() { 59 60 ?> 60 61 <style type="text/css"> 62 #signup-content { width: 90%; margin:0 auto; } 61 63 form { margin-top: 2em; } 62 #submit, #key { width: 90%; font-size: 24px; }64 #submit, #key { width: 100%; font-size: 24px; } 63 65 #language { margin-top: .5em; } 64 66 .error { background: #f66; } 65 67 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 { 610 610 , 'fields' 611 611 , 'menu_order' 612 612 , 'embed' 613 , 'pre_query_page' 613 614 ); 614 615 615 616 foreach ( $keys as $key ) { … … class WP_Query { 1654 1655 } 1655 1656 1656 1657 /** 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 /** 1657 1698 * Retrieve the posts based on query variables. 1658 1699 * 1659 1700 * There are a few filters and actions that can be used to modify the post … … class WP_Query { 2770 2811 * or null to allow WP to run its normal queries. 2771 2812 * @param WP_Query $this The WP_Query instance, passed by reference. 2772 2813 */ 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 ) ); 2774 2815 2775 2816 if ( 'ids' == $q['fields'] ) { 2776 2817 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 { 26 26 * @access public 27 27 * @var array 28 28 */ 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' ); 30 30 31 31 /** 32 32 * 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' ); 5 5 6 6 add_action( 'wp_head', 'wp_no_robots' ); 7 7 8 require( dirname( __FILE__ ) . '/wp-blog-header.php' ); 8 wp( array( 9 'pre_query_page' => 'wp-signup', 10 ) ); 11 12 require( ABSPATH . WPINC . '/template-loader.php' ); 9 13 10 14 if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) { 11 15 wp_redirect( network_home_url() ); … … if ( !is_main_site() ) { 37 41 die(); 38 42 } 39 43 40 // Fix for page title41 $wp_query->is_404 = false;42 43 44 /** 44 45 * Fires before the Site Signup page is loaded. 45 46 *