I'm trying to add sections and fields to a new settings page i WordPress. But I get the response "Call to undefined function add_settings_section()...". Does anybody know why that is? This is the code in question: add_settings_section( 'ac_div', 'Inställningar', 'ac_section_text', 'Anders-counter' );
add_settings_field(
'diven',
'För in mätarställningen här',
'ac_add_field',
'Anders-counter',
'ac_div');
Thankful for help. Anders
add_settings_field
function located under wp-admin/includes/template.php
you can load that file before calling add_settings_field
, or simply add your code under admin_init
hook
add_action('admin_init', 'your_function');
function your_function(){
add_settings_field(
'diven',
'För in mätarställningen här',
'ac_add_field',
'Anders-counter',
'ac_div'
);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With