WP_Scripts::has_inline_script()
Gets data for inline scripts registered for a specific handle.
Метод класса: WP_Scripts{}
Хуков нет.
Возвращает
true|false
. Whether the handle has an inline script (either before or after).
Использование
// private - только в коде основоного (родительского) класса $result = $this->has_inline_script( $handle, $position );
- $handle(строка) (обязательный)
- Name of the script to get data for. Must be lowercase.
- $position(строка)
- The position of the inline script.
По умолчанию: null
Список изменений
С версии 6.3.0 | Введена. |
Код WP_Scripts::has_inline_script() WP Scripts::has inline script WP 6.8
private function has_inline_script( $handle, $position = null ) { if ( $position && in_array( $position, array( 'before', 'after' ), true ) ) { return (bool) $this->get_data( $handle, $position ); } return (bool) ( $this->get_data( $handle, 'before' ) || $this->get_data( $handle, 'after' ) ); }