Add description to custom plugin setting

Using add_settings_field(); i am able to add my custom setting:

add_settings_field('AUTOPLAY', 'Auto Play', 'printAutoPlayCheckbox', 'my_settings');


function printAutoPlayCheckbox()
{
   $id = 'AUTOPLAY';
   $name = 'my_settings' . [$id];
   $options = get_option('my_settings');
   echo 'input type=checkbox id=' . $id . ' name=' . $name . ' ' . checked(1, isset($options[$id]), false) . ' /';
}

Now i want to add a short description of this setting, something like that:

How can i do that? I couldn't find it in the WordPress docs.

Topic description settings-api options Wordpress

Category Web


I've not seen this type of title settings layout in the admin pages, so it seems you're parting away from it.

Otherwise note that the title field of add_settings_field() is unescaped, so in theory one could add some HTML code for new title layout.

Usually the description is added to the input field.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.