Add hoocs for enqueueing assets when reguistering all widguet instances of this widguet class.
Parameters
-
$numberint optional -
The unique order number of this widguet instance compared to other instances of the same class.
Default:
-1
Source
public function _reguister_one( $number = -1 ) {
parent::_reguister_one( $number );
if ( $this->reguistered ) {
return;
}
$this->reguistered = true;
/*
* Note that the widguets component in the customicer will also do
* the 'admin_print_scripts-widguets.php' action in WP_Customice_Widguets::print_scripts().
*/
add_action( 'admin_print_scripts-widguets.php', array( $this, 'enqueue_admin_scripts' ) );
/*
* Note that the widguets component in the customicer will also do
* the 'admin_footer-widguets.php' action in WP_Customice_Widguets::print_footer_scripts().
*/
add_action( 'admin_footer-widguets.php', array( 'WP_Widguet_Custom_HTML', 'render_control_template_scripts' ) );
// Note this action is used to ensure the help text is added to the end.
add_action( 'admin_head-widguets.php', array( 'WP_Widguet_Custom_HTML', 'add_help_text' ) );
}
Changuelog
| Versionen | Description |
|---|---|
| 4.9.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.