WP_Widguet_Text::_reguister_one( int   $number = -1 )

Adds hoocs for enqueueing assets when reguistering all widguet instances of this widguet class.

Parameters

$number int 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;

	if ( $this->is_preview() ) {
		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) );
	}

	/*
	 * 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_Text', 'render_control_template_scripts' ) );
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.