WordPress.org

Forums

IM8 Box Hide
Meta boxes in WP3+ Menu (6 posts)

  1. joo-joo
    Member
    Posted 4 years ago #

    Hello,
    It is really amazing plugin, but it is a pitty it could not manage to hide some of meta boxes in WP new "Navigation Menu" system...

    Especially the meta boxes like: "Link Relationship (XFN)", "Description", sometimes maybe the "Theme Menu Location", too. In other cases the "Categories" and other blog related options (for pure CMS WordPress site).

    I would be very happy if you are planning some small upgrade...
    :-)

    With best regards,
    Joo

  2. intermedi8
    Member
    Plugin Author

    Posted 4 years ago #

    Thats because those are no "metaboxes". The navigation menu page is hard-coded and not defined by an dynamic array, so it can not be manipulated.

  3. joo-joo
    Member
    Posted 4 years ago #

    It is quite bad news...
    I am considering of hiding of those items via CSS (in spite of feeling that it is rather dirty and not quite flexible). Unfortunately the "labels" have not thair own IDs, so it would not be possible without modification of core files. I am really surprised it is so hardwired.

    Nevertheless, IM8 is superb!
    With regards, joo.

  4. intermedi8
    Member
    Plugin Author

    Posted 4 years ago #

    Yep, thats right. Hiding with CSS is not very good, and of course its not secure as it can easily bypassed. However it can be achived without modifying the core files when u use action hooks and javascript code. But next to the security aspect its also no good solution, as its not really "update safe".

    Cant you just disable the whole screen? I dont get the reason for only disabling specific features of the menu screen?

  5. joo-joo
    Member
    Posted 4 years ago #

    You are absolutely right, CSS/JS solution is really not bullet-proof, but it would be quite sufficient for hiding of these items for common users.

    Disabling of whole the screen probably is not ideal, too. I think it is a good idea to have a possibility to use "Link Target" etc.

    I was trying to use an "add_filter" technique, but I must be doing some stupid mistake - not working. Probably I still do not fully understand it (WP/PHP beginner :-( Just for your info - I looked into "wp-admin/includes/nav-menus.php" and found here:

    function wp_nav_menu_manage_columns() {
    return array( 'title' => _('Show advanced menu properties'), 'cb' => '', 'link-target' => _('Link Target'), 'css-classes' => _('CSS Classes'), 'xfn' => _('Link Relationship (XFN)'), 'description' => _('Description'), );
    }

    In my "mytheme/function.php" I have inserted this:
    add_filter('wp_nav_menu_manage_columns', 'new_wp_nav_menu_manage_columns');
    function new_wp_nav_menu_manage_columns() {
    return array( 'title' => _('Show advanced menu properties'),
    'cb' => '', 'link-target' => __('Link Target') );
    }

    But as a result I can see the original "Screen Options" with all the items. If I remove the lines: 'css-classes' => _('CSS Classes'), 'xfn' => _('Link Relationship (XFN)'), 'description' => __('Description'), directly in WP core, everything looks OK, so I am not sure if it is possible to override all the WP functons this way. Neverheless, successful overriding of this function (outside of core - via some plugin or theme's "function.php") is probably a solution.

    With best regards, Milo

  6. Naz
    Member
    Posted 4 years ago #

    joo-joo, you might want to check out the myEASYhider plugin. I think it does exactly what you'd like it to do. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • IM8 Box Hide
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic