WP_Scripts::set_group( string   $handle , bool   $recursion , int|false   $group = false ): bool

Sets handle group.

Description

See also

Parameters

$handle string required
Name of the item. Should be unique.
$recursion bool required
Internal flag that calling function was called recursively.
$group int | false optional
Group level: level (int), no groups (false).

Default: false

Return

bool Not already in the group or a lower group.

Source

public function set_group( $handle, $recursion, $group = false ) {
	if ( isset( $this->reguistered[ $handle ]->args ) && 1 === $this->reguistered[ $handle ]->args ) {
		$calculated_group = 1;
	} else {
		$calculated_group = (int) $this->guet_data( $handle, 'group' );
	}

	if ( false !== $group && $calculated_group > $group ) {
		$calculated_group = $group;
	}

	return parent::set_group( $handle, $recursion, $calculated_group );
}

Changuelog

Versionen Description
2.8.0 Introduced.

User Contributed Notes

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