Make WordPress Core


Ignore:
Timestamp:
05/01/2007 01:13:06 AM (18 years ago)
Author:
rob1n
Message:

Move widget stuff around. see #4169

File:
1 edited

Legend:

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

    r5359 r5360  
    11<?php
     2
     3/*
     4    Check if another widget plugin is active. If this is so,
     5    then bail out.
     6*/
     7
     8if ( function_exists( 'dynamic_sidebars' ) ) {
     9    return;
     10}
    211
    312/* Global Variables */
     13
     14global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_styles, $wp_registered_widget_defaults;
    415
    516$wp_registered_sidebars = array();
     
    1122/* Template tags & API functions */
    1223
    13 if ( !function_exists( 'register_sidebars' ) ):
    1424function register_sidebars($number = 1, $args = array()) {
    1525    $number = (int) $number;
     
    3242    }
    3343}
    34 endif;
    35 
    36 if ( !function_exists( 'register_sidebar' ) ):
     44
    3745function register_sidebar($args = array()) {
    3846    global $wp_registered_sidebars;
     
    5866    return $sidebar['id'];
    5967}
    60 endif;
    61 
    62 if ( !function_exists( 'unregister_sidebar' ) ):
     68
    6369function unregister_sidebar( $name ) {
    6470    global $wp_registered_sidebars;
     
    6773        unset( $wp_registered_sidebars[$name] );
    6874}
    69 endif;
    70 
    71 if ( !function_exists( 'register_sidebar_widget' ) ):
     75
    7276function register_sidebar_widget($name, $output_callback, $classname = '', $id = '') {
    7377    global $wp_registered_widgets, $wp_register_widget_defaults;
     
    101105        $wp_registered_widgets[$id] = $widget;
    102106}
    103 endif;
    104 
    105 if ( !function_exists( 'unregister_sidebar_widget' ) ):
     107
    106108function unregister_sidebar_widget($id) {
    107109    $id = sanitize_title($id);
     
    109111    unregister_widget_control($id);
    110112}
    111 endif;
    112 
    113 if ( !function_exists( 'register_widget_control' ) ):
     113
    114114function register_widget_control($name, $control_callback, $width = 300, $height = 200, $id = '') {
    115115    global $wp_registered_widget_controls, $wp_register_widget_defaults;
     
    143143        );
    144144}
    145 endif;
    146 
    147 if ( !function_exists( 'unregister_widget_control' ) ):
     145
    148146function unregister_widget_control($id) {
    149147    $id = sanitize_title($id);
    150148    return register_widget_control($id, '');
    151149}
    152 endif;
    153 
    154 if ( !function_exists( 'dynamic_sidebar' ) ):
     150
    155151function dynamic_sidebar($index = 1) {
    156152    global $wp_registered_sidebars, $wp_registered_widgets;
     
    186182    return $did_one;
    187183}
    188 endif;
    189 
    190 if ( !function_exists( 'is_active_widget' ) ):
     184
    191185function is_active_widget($callback) {
    192186    global $wp_registered_widgets;
     
    201195    return false;
    202196}
    203 endif;
    204 
    205 if ( !function_exists( 'is_dynamic_sidebar' ) ):
     197
    206198function is_dynamic_sidebar() {
    207199    global $wp_registered_widgets, $wp_registered_sidebars;
     
    216208    return false;
    217209}
    218 endif;
    219210
    220211/* Internal Functions */
     
    910901}
    911902
    912 ?>
     903add_action('init', 'wp_widgets_init', 1);
     904
     905?>
Note: See TracChangeset for help on using the changeset viewer.