Ticket #42270: 42270.patch
File 42270.patch, 1.6 KB (added by , 6 years ago) |
---|
-
wp-includes/widgets.php
100 100 * Registers a WP_Widget widget 101 101 * 102 102 * @since 2.8.0 103 * @since 4.6.0 The `$widget` parameter also accepts a WP_Widget instance object 104 * instead of simply a `WP_Widget` subclass name. 103 105 * 104 106 * @see WP_Widget 105 107 * 106 108 * @global WP_Widget_Factory $wp_widget_factory 107 109 * 108 * @param string $widget_class The name of a class that extends WP_Widget110 * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. 109 111 */ 110 function register_widget( $widget_class) {112 function register_widget( $widget ) { 111 113 global $wp_widget_factory; 112 114 113 $wp_widget_factory->register( $widget_class);115 $wp_widget_factory->register( $widget ); 114 116 } 115 117 116 118 /** … … 120 122 * Run within a function hooked to the {@see 'widgets_init'} action. 121 123 * 122 124 * @since 2.8.0 125 * @since 4.6.0 The `$widget` parameter also accepts a WP_Widget instance object 126 * instead of simply a `WP_Widget` subclass name. 123 127 * 124 128 * @see WP_Widget 125 129 * 126 130 * @global WP_Widget_Factory $wp_widget_factory 127 131 * 128 * @param string $widget_class The name of a class that extends WP_Widget.132 * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. 129 133 */ 130 function unregister_widget( $widget_class) {134 function unregister_widget( $widget ) { 131 135 global $wp_widget_factory; 132 136 133 $wp_widget_factory->unregister( $widget_class);137 $wp_widget_factory->unregister( $widget ); 134 138 } 135 139 136 140 /**