Automattic\WooCommerce\Internal\Admin\Logging
Settings::get_level_threshold_setting_definition
The definition for the level_threshold setting.
Метод класса: Settings{}
Хуков нет.
Возвращает
Массив.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_level_threshold_setting_definition(): array;
Код Settings::get_level_threshold_setting_definition() Settings::get level threshold setting definition WC 10.4.3
private function get_level_threshold_setting_definition(): array {
$hardcoded = ! is_null( Constants::get_constant( 'WC_LOG_THRESHOLD' ) );
$desc = '';
if ( $hardcoded ) {
$desc = sprintf(
// translators: %1$s is the name of a code variable. %2$s is the name of a file.
__( 'This setting cannot be changed here because it is defined in the %1$s constant, probably in your %2$s file.', 'woocommerce' ),
'<code>WC_LOG_THRESHOLD</code>',
'<b>wp-config.php</b>'
);
}
$labels = WC_Log_Levels::get_all_level_labels();
$labels['none'] = __( 'None', 'woocommerce' );
$custom_attributes = array();
if ( $hardcoded ) {
$custom_attributes['disabled'] = 'true';
}
return array(
'title' => __( 'Level threshold', 'woocommerce' ),
'desc_tip' => __( 'This sets the minimum severity level of logs that will be stored. Lower severity levels will be ignored. "None" means all logs will be stored.', 'woocommerce' ),
'id' => self::PREFIX . 'level_threshold',
'type' => 'select',
'value' => $this->get_level_threshold(),
'default' => self::DEFAULTS['level_threshold'],
'autoload' => false,
'options' => $labels,
'custom_attributes' => $custom_attributes,
'css' => 'width:auto;',
'desc' => $desc,
);
}