[wp-trac] [WordPress Trac] #25344: Introduce *_network_meta() functions

WordPress Trac noreply at wordpress.org
Tue Apr 18 15:49:16 UTC 2017


#25344: Introduce *_network_meta() functions
-------------------------------------------------+-------------------------
 Reporter:  jeremyfelt                           |       Owner:
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
Component:  Networks and Sites                   |  Release
 Severity:  normal                               |     Version:  3.0
 Keywords:  reporter-feedback has-patch needs-   |  Resolution:
  testing has-unit-tests                         |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by flixos90):

 I uploaded a new set of patches - set as I have splitted the network meta
 API introduction (see [attachment:25344.10.network-meta.diff]) from its
 implementation in the `*_network_option()` functions (see
 [attachment:25344.10.network-options.diff]), to have a better overview and
 to be able to later commit them separately (that does ''not'' imply I'm
 wary of any of the two parts). Be aware that the network options patch
 relies on the network meta patch in order to work.

 Some changes I made in [attachment:25344.10.network-meta.diff]:
 * Remove the fix in `src/wp-includes/meta.php` as that does not belong
 into this patch, but into a patch on #38203.
 * Bust network query cache when network meta is added/updated/deleted.
 * Introduce meta query functionality for `WP_Network_Query`. Meta query
 functionality is only available if the class has already been loaded; that
 means that no meta queries are supported in `sunrise.php` at the moment.
 We can revisit after figuring out loading order of files (see below).
 * Move the `*_network_meta()` functions into `src/wp-includes/ms-
 blogs.php`. The names of the two files (`ms-blogs.php` and `ms-
 functions.php`) are really confusing, but all basic site and network
 functionality resides in `ms-blogs.php` for now, and questioning that
 belongs into another ticket IMO (although it's probably worth doing that
 at some point). This also makes the patch more clear and reduces chances
 for unexpected bugs, as we don't need to change the loading order of
 files. It's certainly sub-optimal that `meta.php` is loaded after some
 other stuff that relies on it, but this happens in a broader scope -
 again, that belongs into another ticket I think. I don't like to clutter
 this patch here with such things, so maybe we should open a ticket to
 rethink the multisite file structure in general, and then adjust this
 patch after we have figured that out.
 * Add tests for network meta functionality (@spacedmonkey, looks like you
 forgot to do `svn add` :) ).

 I didn't change anything in [attachment:25344.10.network-options.diff].
 However, that patch currently does not work because of the loading order
 that we need to discuss (so here it ''is'' critical, see above).
 Functionality-wise, I don't see anything we need to change in the patch.
 Once we get it back to work, we of course need to verify through unit
 tests.

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


More information about the wp-trac mailing list