WP_Screen::get_option
Gets the arguments for an option for the screen.
Метод класса: WP_Screen{}
Хуков нет.
Возвращает
Строку. The option value if set, null otherwise.
Использование
$WP_Screen = new WP_Screen(); $WP_Screen->get_option( $option, $key );
- $option(строка) (обязательный)
- Option name.
- $key(строка|false)
- Specific array key for when the option is an array.
По умолчанию: false
Список изменений
| С версии 3.3.0 | Введена. |
Код WP_Screen::get_option() WP Screen::get option WP 6.9
public function get_option( $option, $key = false ) {
if ( ! isset( $this->_options[ $option ] ) ) {
return null;
}
if ( $key ) {
if ( isset( $this->_options[ $option ][ $key ] ) ) {
return $this->_options[ $option ][ $key ];
}
return null;
}
return $this->_options[ $option ];
}