WordPress.org

Make WordPress Core

Ticket #10667: plug-objects.diff

File plug-objects.diff, 667 bytes (added by andy, 5 years ago)

Allow core classes WP_Query and WP to be replaced before instantiating.

  • wp-settings.php

     
    193193 * @global object $wp_the_query 
    194194 * @since 2.0.0 
    195195 */ 
    196 $wp_the_query =& new WP_Query(); 
     196if ( isset($WP_Query) && class_exists($WP_Query) ) 
     197        $wp_the_query =& new $WP_Query(); 
     198else 
     199        $wp_the_query =& new WP_Query(); 
    197200 
    198201/** 
    199202 * Holds the reference to @see $wp_the_query 
     
    215218 * @global object $wp 
    216219 * @since 2.0.0 
    217220 */ 
    218 $wp =& new WP(); 
     221if ( isset($WP) && class_exists($WP) ) 
     222        $wp =& new $WP(); 
     223else 
     224        $wp =& new WP(); 
    219225 
    220226/** 
    221227 * WordPress Widget Factory Object