null callback in add_settings_section

Some code I’m looking at from a Plugin contains this line

add_settings_section("section", "Settings", null, "theme-options");

which has a null callback.

Having looked at
it says

$callback – (string) (required) Function that fills the section with the desired content. The function should echo its output.

So, why is this null and what are the implications?

Solutions Collecting From Web of "null callback in add_settings_section"

$callback = NULL means there is the $callback variable but it has no the value.

In this case, unless you add any setting fields by add_setting_field() and register those settings by register_setting(), you’ll get the Settings subheader on the Settings page without any content in this section.

Here is an old tutorial which can be useful to show what I’m talking about. See the third screenshot and the code above it.


  • add_setting_field()

  • register_setting()

  • Settings API