Мне удалось добавить его на вкладке «Общие»;
Код: Выделить всё
function add_token_input($settings)
{
$updated_settings = [];
foreach ($settings as $section) {
if (
isset($section['id']) && 'general_options' == $section['id'] &&
isset($section['type']) && 'sectionend' == $section['type']
) {
$updated_settings[] = [
'name' => __('Token ', 'wc_seq_order_numbers'),
'desc_tip' => __('Place your request token', 'wc_seq_order_numbers'),
'id' => 'my-plugin-name',
'type' => 'password',
'css' => 'min-width:300px;',
'std' => '', // WC < 2.0
'default' => '', // WC >= 2.0
'desc' => __('Exemplo: b4e58140b61cf086c82153f6c371668684f6ca71'),
];
}
$updated_settings[] = $section;
}
return $updated_settings;
}
add_action("woocommerce_general_settings", 'add_token_input');
Подробнее здесь: https://stackoverflow.com/questions/792 ... b-settings
Мобильная версия