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

WordPress Trac noreply at wordpress.org
Mon Apr 10 15:19:55 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                                        |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 Updated patch with a better solution for getting network meta.

 See my solution.
 {{{#!php
         $meta = get_network_meta( $network_id, $option );
          if ( is_array( $meta ) && ! empty( $meta ) ) {
                 $value = array_shift( $meta );
          } else {
                 $value = $default;
          }
 }}}
 The meta api current supports storing multiple rows in one key. However
 network options do not support it. There could be issues with using the
 meta functions do write multiple rows then never being able to get the out
 the db. This work around allows for all the items to be received but the
 first is used.

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


More information about the wp-trac mailing list