[wp-trac] [WordPress Trac] #46351: Properly re-fill the `$meta` param of deprecated `wpmu_new_blog` action

WordPress Trac noreply at wordpress.org
Sun Mar 3 02:10:50 UTC 2019


#46351: Properly re-fill the `$meta` param of deprecated `wpmu_new_blog` action
--------------------------------+------------------------
 Reporter:  david.binda         |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  5.1.1
Component:  Networks and Sites  |     Version:  5.1
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+------------------------

Comment (by pbiron):

 @davidbinda: I've just been testing your patch.  Is your intention to
 **exactly** duplicate the behavior of WP <=5.0.3?  If so, it does not do
 that.  I don't think it does anything **wrong**, but is results in `$meta`
 containing **more** info than would be provided in 5.0.3.

 For example, when adding a new site via `/wp-admin/network/site-new.php`,
 the value of `$meta` passed to functions hooked to `wpmu_new_blog` is:

 == in 5.0.3
 {{{#!php
 $meta = array(
         'public' => 1,
         'WP_LANG' => get_network_option( $network_id, 'WPLANG' ),
 )
 }}}

 == in 5.1, without your patch
 {{{#!php
 $meta = array(
         'WPLANG' => get_network_option( $network_id, 'WPLANG' ),
 )
 }}}
 * so, yes, without the patch the value of `public` is not passed
 == in 5.1, with your patch
 {{{#!php
 $meta = array(
         'public' => 1,
         'archived' => 0,
         'mature' => 0,
         'spam' => 0,
         'deleted' => 0,
         'lang_id' => 0,
         'WPLANG' => get_network_option( $network_id, 'WPLANG' ),
 )
 }}}
 * the values of `archived`, `mature`, `spam`, `deleted` and `lang_id`
 where **not** passed in 5.0.3

 So, again, I'm not suggesting that your patch is wrong, just that it
 results in slightly different behavior (for the default case of creating a
 site in the WP admin module) than 5.0.3.

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


More information about the wp-trac mailing list