|
Post by mimjannat109 on Jan 9, 2024 6:03:18 GMT
Function test_custom_settings, name for the section to add 'New Reading Settings visible on the page 'reading_section_description. Adding Fields to Sections Settings Fields represent the WordPress Theme Options and are part of the sections. The settings fields show as part of a section inside a settings page. API: add_settings_field – To add settings fields to section. After you define the theme section, call this API from inside an initializer function like the admin_init hook defined in the functions.php file. You can use this API for as many settings fields that you need to define for your section. add_settings_field string id, string title, callable callback, string page, string section = 'default', array args = array Parameters Email Marketing List Name Type Required/Optional Description id string Required ID of the field title string Required Title of the field callback callable Required Function to display the setting page string Optional. The slug-name of the settings page where setting is displayed section string Optional The slug-name of the section of the settings page in which to show the option args array Optional Extra arguments used when displaying the field Note that this function takes as input the settings page slug and the section id to which the setting belongs. Return Value: void Sample Code: The sample code demonstrates the use of this API to add a new field to the “first_section” section of the ‘Reading’ page.
|
|