WP_Scripts::set_group
Sets handle group.
Method of the class: WP_Scripts{}
No Hooks.
Returns
true|false. Not already in the group or a lower group.
Usage
global $wp_scripts; $wp_scripts->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)
- Group level: level (int), no groups (false).
Default:false
Notes
Changelog
| Since 2.8.0 | Introduced. |
WP_Scripts::set_group() WP Scripts::set group code WP 7.0
public function set_group( $handle, $recursion, $group = false ) {
if ( isset( $this->registered[ $handle ]->args ) && 1 === $this->registered[ $handle ]->args ) {
$calculated_group = 1;
} else {
$calculated_group = (int) $this->get_data( $handle, 'group' );
}
if ( false !== $group && $calculated_group > $group ) {
$calculated_group = $group;
}
return parent::set_group( $handle, $recursion, $calculated_group );
}