Modifying form code with echo do_settings_sections(‘rma’) ?
‘something’ : ‘nothing’; renders nothing, so
do_settings_sections(‘rma’) is empty.
With that in mind, I dont see you adding a section in your posted code.
If you add a section to your register_rma_settings()
function, and than add this section to your add_settings_field()
, than the input will show.
function register_rma_settings() {
// add_settings_section( $id, $title, $callback, $page );
// you can use $callback to add some descriptive text otherwise leave it blank, ''
add_settings_section( 'rma_section', 'some title', 'section_description', 'rma' );
register_setting('rma_options', 'rma_base_url');
// we also added our new section id "rma_section" at last argument to the following function
add_settings_field('rma_base_url', 'Base URL', 'rma_base_url_string', 'rma', 'rma_section');
}
Do you not want to use any section or why you have not created one?
Update
@geoB yeah first I had also the impression that you dont necessarily need to define a section in the add_settings_field()
function.
When we read the codex about that function, we see the section
argument as optional
, like $section (string) (optional)
BUT we can also see that if we did not add a section
, the argument will use default
.
I also tried inserting specifically 'default'
as a section argument, but the setting will not show up. (even not on other settings pages)
I than tried inserting ''
as a section argument, but also, nothing is shown.
So it seems that section
is not really optional.