Add option to media-library
-
Hi I am trying to add a custom option under media-library page
add_action(‘admin_init’, ‘my_general_section’);
function my_general_section() {
// add_settings_section(
// ‘Descriptionx’, // Section ID
// ‘My Options Title’, // Section Title
// ‘my_section_options_callback’, // Callback
// ‘settings_page_media-library’ // What Page? This makes the section show up on the General Settings Page
// );add_settings_field( // Option 2
‘option_2’, // Option ID
‘Option 2’, // Label
‘my_textbox_callback’, // !important – This is where the args go!
‘media-library’, // Page it will be displayed
‘Descriptionx’, // Name of our section (General Settings)
array( // The $args
‘option_2’ // Should match Option ID
)
);register_setting(‘media-library’,’option_2′, ‘wpuxss_eml_lib_options_validate’);
}function my_section_options_callback() { // Section Callback
echo ‘<p>A little message on editing info</p>’;
}function my_textbox_callback($args) { // Textbox Callback
echo ‘<input type=”text” id=”‘. $args[0] .'” name=”‘. $args[0] .'” value=”‘ . $option . ‘” />’;
}
`can please someone tell me what am doing wrong
- The topic ‘Add option to media-library’ is closed to new replies.