Changeset 5360 for branches/2.2/wp-includes/widgets.php
- Timestamp:
- 05/01/2007 01:13:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/wp-includes/widgets.php
r5359 r5360 1 1 <?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 } 2 11 3 12 /* Global Variables */ 13 14 global $wp_registered_sidebars, $wp_registered_widgets, $wp_registered_widget_controls, $wp_registered_widget_styles, $wp_registered_widget_defaults; 4 15 5 16 $wp_registered_sidebars = array(); … … 11 22 /* Template tags & API functions */ 12 23 13 if ( !function_exists( 'register_sidebars' ) ):14 24 function register_sidebars($number = 1, $args = array()) { 15 25 $number = (int) $number; … … 32 42 } 33 43 } 34 endif; 35 36 if ( !function_exists( 'register_sidebar' ) ): 44 37 45 function register_sidebar($args = array()) { 38 46 global $wp_registered_sidebars; … … 58 66 return $sidebar['id']; 59 67 } 60 endif; 61 62 if ( !function_exists( 'unregister_sidebar' ) ): 68 63 69 function unregister_sidebar( $name ) { 64 70 global $wp_registered_sidebars; … … 67 73 unset( $wp_registered_sidebars[$name] ); 68 74 } 69 endif; 70 71 if ( !function_exists( 'register_sidebar_widget' ) ): 75 72 76 function register_sidebar_widget($name, $output_callback, $classname = '', $id = '') { 73 77 global $wp_registered_widgets, $wp_register_widget_defaults; … … 101 105 $wp_registered_widgets[$id] = $widget; 102 106 } 103 endif; 104 105 if ( !function_exists( 'unregister_sidebar_widget' ) ): 107 106 108 function unregister_sidebar_widget($id) { 107 109 $id = sanitize_title($id); … … 109 111 unregister_widget_control($id); 110 112 } 111 endif; 112 113 if ( !function_exists( 'register_widget_control' ) ): 113 114 114 function register_widget_control($name, $control_callback, $width = 300, $height = 200, $id = '') { 115 115 global $wp_registered_widget_controls, $wp_register_widget_defaults; … … 143 143 ); 144 144 } 145 endif; 146 147 if ( !function_exists( 'unregister_widget_control' ) ): 145 148 146 function unregister_widget_control($id) { 149 147 $id = sanitize_title($id); 150 148 return register_widget_control($id, ''); 151 149 } 152 endif; 153 154 if ( !function_exists( 'dynamic_sidebar' ) ): 150 155 151 function dynamic_sidebar($index = 1) { 156 152 global $wp_registered_sidebars, $wp_registered_widgets; … … 186 182 return $did_one; 187 183 } 188 endif; 189 190 if ( !function_exists( 'is_active_widget' ) ): 184 191 185 function is_active_widget($callback) { 192 186 global $wp_registered_widgets; … … 201 195 return false; 202 196 } 203 endif; 204 205 if ( !function_exists( 'is_dynamic_sidebar' ) ): 197 206 198 function is_dynamic_sidebar() { 207 199 global $wp_registered_widgets, $wp_registered_sidebars; … … 216 208 return false; 217 209 } 218 endif;219 210 220 211 /* Internal Functions */ … … 910 901 } 911 902 912 ?> 903 add_action('init', 'wp_widgets_init', 1); 904 905 ?>
Note: See TracChangeset
for help on using the changeset viewer.