plugins – Adding Settings field to SubMenu Pages

Question

I am trying to add the Settings field to SubMenu Pages,
I have tried following the below approach

add_settings_field( // Option 1
    'option_1', // Option ID
    'Option 1', // Label
    'my_textbox_callback', // !important - This is where the args go!
    'media-library', // Page it will be displayed (General Settings)
    'Description', // Name of our section
    array( // The $args
        'option_1' // Should match Option ID
    )  
); 

Code to make submenu page

$eml_mimetype_options_page = add_submenu_page(
        'options-general.php',
        __('MIME Types','enhanced-media-library') . ' ‹ ' . __('Media Settings','enhanced-media-library'),
        __('MIME Types','enhanced-media-library'),
        'manage_options',
        'mime-types',
        'wpuxss_eml_print_mimetypes_options'
    );

The add_settings_field option is working with the media page, but not with submenu pages.
Please help me out and before flagging this question as duplicate , this question is differ from other.

0
Rajneesh Tiwari 1 month 2021-06-23T09:30:01-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse