WP Manifestindependent plugin directory
manifest / admin / wp-submenu-3000

Submenu 3000

Automatically add submenu items to hierarchical post type menu items

★ 0stars
v1.0.0latest · 8 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/barryceelen/wp-submenu-3000/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

WordPress automatic submenu plugin

If no submenu item is explicitly set, this plugin automatically adds submenu items if the menu item points to a hierarchical post type.

The plugin acts on all menus and respects the 'depth' option. To disable the plugin for a specific menu, add a filter:

add_filter( 'submenu_3000', 'prefix_filter_submenu_3000', 10, 4 );

/**
 * Only add submenu items to a specific theme location.
 *
 * @param string   $item_output The menu item's starting HTML output.
 * @param WP_Post  $item        Menu item data object.
 * @param int      $depth       Depth of menu item. Used for padding.
 * @param stdClass $args        An object of wp_nav_menu() arguments.
 */
function prefix_filter_submenu_3000( $item_output, $item, $depth, $args ) {

    if ( 'primary' !== $args->theme_location ) {
        return false;
    }
}
  • Filter the CSS classes for a submenu <ul> element: submenu_3000_submenu_css_class
  • Filter he HTML attributes for a submenu
      element: submenu_3000_submenu_attributes
  • Filter the CSS classes for a submenu item <li> element: submenu_3000_item_css_class
  • Filter the HTML attributes for a submenu item link element: submenu_3000_menu_link_attributes

Read More

Releases

1 release.

Tag
Published
v1.0.0 latest
Nov 7, 2017 8 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.