WP_Dependencies::set_group()publicWP 2.8.0

Set item group, unless already in a lower group.

Method of the class: WP_Dependencies{}

No Hooks.


true|false. Not already in the group or a lower group.


$WP_Dependencies = new WP_Dependencies();
$WP_Dependencies->set_group( $handle, $recursion, $group );
$handle(string) (required)
Name of the item. Should be unique.
$recursion(true|false) (required)
Internal flag that calling function was called recursively.
$group(int|false) (required)
Group level: level (int), no group (false).


Since 2.8.0 Introduced.

WP_Dependencies::set_group() code WP 6.4.3

public function set_group( $handle, $recursion, $group ) {
	$group = (int) $group;

	if ( isset( $this->groups[ $handle ] ) && $this->groups[ $handle ] <= $group ) {
		return false;

	$this->groups[ $handle ] = $group;

	return true;