WP_Scripts::set_group

Advertisement

Summery Summery

Sets handle group.

Syntax Syntax

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

Parameters Parameters

$handle

(Required) Name of the item. Should be unique.

$recursion

(Required) Internal flag that calling function was called recursively.

$group

(Optional) Group level: level (int), no groups (false).

Default value: false

Return Return

(bool) Not already in the group or a lower group.

Source Source

File: wp-includes/class.wp-scripts.php

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

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

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

Advertisement

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.

See also See also

Advertisement

Leave a Reply