diff --git src/wp-includes/widgets/class-wp-widget-media.php src/wp-includes/widgets/class-wp-widget-media.php
index c76989c873..1724b23780 100644
|
|
|
abstract class WP_Widget_Media extends WP_Widget { |
| 34 | 34 | ); |
| 35 | 35 | |
| 36 | 36 | /** |
| | 37 | * Whether or not the widget has been registered yet. |
| | 38 | * |
| | 39 | * @since 4.8.1 |
| | 40 | * @var bool |
| | 41 | */ |
| | 42 | protected $registered = false; |
| | 43 | |
| | 44 | /** |
| 37 | 45 | * Constructor. |
| 38 | 46 | * |
| 39 | 47 | * @since 4.8.0 |
| … |
… |
abstract class WP_Widget_Media extends WP_Widget { |
| 87 | 95 | * @since 4.8.0 |
| 88 | 96 | * @access public |
| 89 | 97 | */ |
| 90 | | public function _register() { |
| | 98 | public function _register_one() { |
| | 99 | parent::_register_one(); |
| | 100 | if ( $this->registered ) { |
| | 101 | return; |
| | 102 | } |
| | 103 | $this->registered = true; |
| 91 | 104 | |
| 92 | 105 | // Note that the widgets component in the customizer will also do the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). |
| 93 | 106 | add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) ); |
| … |
… |
abstract class WP_Widget_Media extends WP_Widget { |
| 100 | 113 | add_action( 'admin_footer-widgets.php', array( $this, 'render_control_template_scripts' ) ); |
| 101 | 114 | |
| 102 | 115 | add_filter( 'display_media_states', array( $this, 'display_media_state' ), 10, 2 ); |
| 103 | | |
| 104 | | parent::_register(); |
| 105 | 116 | } |
| 106 | 117 | |
| 107 | 118 | /** |
diff --git src/wp-includes/widgets/class-wp-widget-text.php src/wp-includes/widgets/class-wp-widget-text.php
index 7d149c0a0f..14dc7b38bb 100644
|
|
|
|
| 17 | 17 | class WP_Widget_Text extends WP_Widget { |
| 18 | 18 | |
| 19 | 19 | /** |
| | 20 | * Whether or not the widget has been registered yet. |
| | 21 | * |
| | 22 | * @since 4.8.1 |
| | 23 | * @var bool |
| | 24 | */ |
| | 25 | protected $registered = false; |
| | 26 | |
| | 27 | /** |
| 20 | 28 | * Sets up a new Text widget instance. |
| 21 | 29 | * |
| 22 | 30 | * @since 2.8.0 |
| … |
… |
class WP_Widget_Text extends WP_Widget { |
| 41 | 49 | * @since 4.8.0 |
| 42 | 50 | * @access public |
| 43 | 51 | */ |
| 44 | | public function _register() { |
| | 52 | public function _register_one() { |
| | 53 | parent::_register_one(); |
| | 54 | if ( $this->registered ) { |
| | 55 | return; |
| | 56 | } |
| | 57 | $this->registered = true; |
| 45 | 58 | |
| 46 | 59 | // Note that the widgets component in the customizer will also do the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). |
| 47 | 60 | add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) ); |
| 48 | 61 | |
| 49 | 62 | // Note that the widgets component in the customizer will also do the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts(). |
| 50 | 63 | add_action( 'admin_footer-widgets.php', array( $this, 'render_control_template_scripts' ) ); |
| 51 | | |
| 52 | | parent::_register(); |
| 53 | 64 | } |
| 54 | 65 | |
| 55 | 66 | /** |