[wp-trac] [WordPress Trac] #40447: Add cache domain to site/network query

WordPress Trac noreply at wordpress.org
Fri Apr 14 15:33:42 UTC 2017


#40447: Add cache domain to site/network query
--------------------------------+------------------------
 Reporter:  ocean90             |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  4.8
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+------------------------

Comment (by ocean90):

 On second thought, you can use the `parse_site_query` to register a custom
 query var like so:
 {{{#!php
 <?php
 function add_custom_query_var_to_default_query_vars( $query ) {
         if ( ! empty( $query->query_vars['custom_query_var' ] ) ) {
                 $query->query_var_defaults = array_merge(
 $query->query_var_defaults, [ 'custom_query_var' => '' ] );
         }
 }
 add_action( 'parse_site_query', __NAMESPACE__ .
 '\add_custom_query_var_to_default_query_vars' );
 }}}

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


More information about the wp-trac mailing list