[wp-trac] [WordPress Trac] #35422: only exit if the redirect is true when registering on multisites

WordPress Trac noreply at wordpress.org
Thu Jan 21 10:14:29 UTC 2016


#35422: only exit if the redirect is true when registering on multisites
------------------------------------+------------------------------
 Reporter:  pbearne                 |       Owner:
     Type:  enhancement             |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Login and Registration  |     Version:  trunk
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch               |     Focuses:  multisite
------------------------------------+------------------------------

Comment (by JasWSInc):

 I'm the lead at s2Member. Thank you all for taking a look at this.

 Without diving deep into the assortment of hooks/filters that s2Member
 uses to make this feasible, because it's not just this one in particular
 that is required for it all to come together; let me just say that what
 would ''really'' help is to give plugin developers a way to prevent this
 redirection and exit when desirable.

 Here is what's in core right now.

 {{{#!php
 <?php
 case 'register' :
         if ( is_multisite() ) {
                 /**
                  * Filter the Multisite sign up URL.
                  *
                  * @since 3.0.0
                  *
                  * @param string $sign_up_url The sign up URL.
                  */
                 wp_redirect( apply_filters( 'wp_signup_location',
 network_site_url( 'wp-signup.php' ) ) );
                 exit;
         }
 }}}

 Proposed addition of a new filter: `require_wp_signup`

 {{{#!php
 <?php
 case 'register' :
         if ( apply_filters( 'require_wp_signup', is_multisite() ) ) {
                 /**
                  * Filter the Multisite sign up URL.
                  *
                  * @since 3.0.0
                  *
                  * @param string $sign_up_url The sign up URL.
                  */
                 wp_redirect( apply_filters( 'wp_signup_location',
 network_site_url( 'wp-signup.php' ) ) );
                 exit;
         }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35422#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list