WP_Scripts::set_group
Sets handle group.
Метод класса: WP_Scripts{}
Хуков нет.
Возвращает
true|false. Not already in the group or a lower group.
Использование
global $wp_scripts; $wp_scripts->set_group( $handle, $recursion, $group );
- $handle(строка) (обязательный)
- Name of the item. Should be unique.
- $recursion(true|false) (обязательный)
- Internal flag that calling function was called recursively.
- $group(int|false)
- Group level: level (int), no groups (false).
По умолчанию: false
Заметки
- Смотрите: WP_Dependencies::set_group()
Список изменений
| С версии 2.8.0 | Введена. |
Код WP_Scripts::set_group() WP Scripts::set group WP 6.9
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 );
}