Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on a website and added a custom meta option for all pages / posts called: "Location".

$value = get_post_meta( $post->ID, '_privacy_location', true );

I'd like to add the value on the menu item in: Appearance->Menus so my client can see what pages have which location !

Can't figure out what hook to use ! Help plz :)

share|improve this question
    
Try this: justintadlock.com/archives/2011/06/27/… –  GhostToast Jun 3 '13 at 14:59
    
Thanks, but I need to do this for the Menu, not the pages / posts –  mkprogramming Jun 3 '13 at 15:18
    
Ah, sorry, misunderstood. Thought you meant 'admin menu', despite you clearly saying "apperances->menu". –  GhostToast Jun 3 '13 at 15:19

1 Answer 1

The menu items boxes are created by the class Walker_Nav_Menu_Edit in wp-admin/includes/nav-menu.php.

Thus to alter those boxes you'll have to make your custom Walker I guess.

But if you mean adding the new value to the nav menu meta-boxes (the boxes to the left side of the page) this will do the job:

The function that adds new meta_boxes:

function my_function() {
   add_meta_box( 'foo', __( 'Fooo' ), 'callback_function' , 'nav-menus', 'side', 'default' );
}

The callback that renders the output for the new boxes:

function callback_function( ) {
  global $wp_meta_boxes;
  var_dump($wp_meta_boxes);
}

And you can use both:

add_filter( 'manage_nav-menus_columns', 'my_function');

or

add_action('admin_init', 'my_function');
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.