WordPress how to add a section to nav-menus.php?

I am creating a plugin that extends Wordpress custom menus, and I would like to put new options on it on the current page of the custom menu, but I cannot figure out how to add new sections to it.

I tried adding a section to "nav-menus.php", but this does not seem to have an effect:

add_action('admin_init', 'menu_initialize_theme_options'); function menu_initialize_theme_options() { add_settings_section( 'menu_settings_section', 'menu Options', 'menu_general_options_callback', 'nav-menus.php' ); add_settings_field( 'test_field', 'Test', 'menu_test_field_callback', 'nav-menus.php', 'menu_settings_section', array( 'Activate this setting to TEST.' ) ); register_setting( 'nav-menus.php', 'test_field' ); } function menu_test_field_callback($args) { $html = '<input type="checkbox" id="test_field" name="test_field" value="1" ' . checked(1, get_option('test_field'), false) . '/>'; $html .= '<label for="test_field"> ' . $args[0] . '</label>'; echo $html; } 

How do I add sections to this page?

I would really like to be able to edit the current menu options inside nav-menus.php (to add more fields to each menu item), do I have to do this?

+4
source share
1 answer
 add_meta_box( 'metabox-id', 'metabox-title', 'box-callback', 'nav-menus', 'side', 'low' ); 

Create the first and second parameters. The third parameter should be your callback function name to create the contents of the window. The fourth parameter is the key to get the field on this page "navigation menu". The sixth can be โ€œhighโ€, โ€œprimaryโ€, โ€œdefaultโ€ or โ€œlowโ€.

http://codex.wordpress.org/Function_Reference/add_meta_box

+1
source

All Articles