WordPress.org

Make WordPress Core

Changeset 5363


Ignore:
Timestamp:
05/01/07 01:58:18 (11 years ago)
Author:
rob1n
Message:

New way of loading widgets that works with PHP 5. Thanks to filosofo for testing. see #4169

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-includes/default-filters.php

    r5360 r5363  
    175175add_action('init', 'smilies_init', 5); 
    176176 
    177 add_action( 'plugins_loaded', 'wp_load_widgets', 0 ); 
     177add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); 
    178178 
    179179?> 
  • branches/2.2/wp-includes/functions.php

    r5360 r5363  
    14691469} 
    14701470 
    1471 function wp_load_widgets() { 
    1472     require_once ABSPATH . WPINC . '/widgets.php'; 
     1471function wp_maybe_load_widgets() { 
     1472    if ( !function_exists( 'dynamic_sidebar' ) ) { 
     1473        require_once ABSPATH . WPINC . '/widgets.php'; 
     1474    } 
    14731475} 
    14741476 
  • branches/2.2/wp-includes/widgets.php

    r5360 r5363  
    11<?php 
    2  
    3 /* 
    4     Check if another widget plugin is active. If this is so,  
    5     then bail out. 
    6 */ 
    7  
    8 if ( function_exists( 'dynamic_sidebars' ) ) { 
    9     return; 
    10 } 
    112 
    123/* Global Variables */ 
  • trunk/wp-includes/default-filters.php

    r5360 r5363  
    175175add_action('init', 'smilies_init', 5); 
    176176 
    177 add_action( 'plugins_loaded', 'wp_load_widgets', 0 ); 
     177add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); 
    178178 
    179179?> 
  • trunk/wp-includes/functions.php

    r5360 r5363  
    15031503} 
    15041504 
    1505 function wp_load_widgets() { 
    1506     require_once ABSPATH . WPINC . '/widgets.php'; 
     1505function wp_maybe_load_widgets() { 
     1506    if ( !function_exists( 'dynamic_sidebar' ) ) { 
     1507        require_once ABSPATH . WPINC . '/widgets.php'; 
     1508    } 
    15071509} 
    15081510 
  • trunk/wp-includes/widgets.php

    r5362 r5363  
    11<?php 
    2  
    3 /* 
    4     Check if another widget plugin is active. If this is so,  
    5     then bail out. 
    6 */ 
    7  
    8 if ( function_exists( 'dynamic_sidebar' ) ) { 
    9     return; 
    10 } 
    112 
    123/* Global Variables */ 
Note: See TracChangeset for help on using the changeset viewer.