{"id":77567,"date":"2017-11-13T11:00:47","date_gmt":"2017-11-13T11:00:47","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/automatic-submenu\/"},"modified":"2017-11-13T11:45:47","modified_gmt":"2017-11-13T11:45:47","slug":"automatic-submenu","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/automatic-submenu\/","author":8254666,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"trunk","tested":"4.8.28","requires":"3.1","requires_php":"","requires_plugins":"","header_name":"Automatic Submenu","header_author":"John Rallis (rallisf1)","header_description":"Automatically append children posts and pages as submenu items","assets_banners_color":"bac5c2","last_updated":"2017-11-13 11:45:47","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.me\/rallisf1","header_plugin_uri":"https:\/\/github.com\/wp-automatic-plugin","header_author_uri":"https:\/\/www.facebook.com\/rallisf1","rating":3,"author_block_rating":0,"active_installs":10,"downloads":2715,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":"1","2":0,"3":0,"4":0,"5":"1"},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":"1765022","resolution":"128x128","location":"assets"},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":"1765022","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":"1765022","resolution":"1544x500","location":"assets"},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1765022","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":"1765022","resolution":"1","location":"assets"}},"screenshots":{"1":"How it looks like in the menu editor"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2868,1865,243,166,9659],"plugin_category":[43],"plugin_contributors":[149233],"plugin_business_model":[],"class_list":["post-77567","plugin","type-plugin","status-publish","hentry","plugin_tags-children","plugin_tags-menu","plugin_tags-pages","plugin_tags-posts","plugin_tags-submenu","plugin_category-customization","plugin_contributors-rallisf1","plugin_committers-rallisf1"],"banners":{"banner":"https:\/\/ps.w.org\/automatic-submenu\/assets\/banner-772x250.jpg?rev=1765022","banner_2x":"https:\/\/ps.w.org\/automatic-submenu\/assets\/banner-1544x500.jpg?rev=1765022","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/automatic-submenu\/assets\/icon-128x128.jpg?rev=1765022","icon_2x":"https:\/\/ps.w.org\/automatic-submenu\/assets\/icon-256x256.jpg?rev=1765022","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/automatic-submenu\/assets\/screenshot-1.jpg?rev=1765022","caption":"How it looks like in the menu editor"}],"raw_content":"<!--section=description-->\n<p>Ever wanted to be able to automatically have category and pages children automatically added to your menus? I'm sure I did and was disappointed to not find something that dead simple that works and doesn't mess up with the theme or other plugins.<\/p>\n\n<p>Now bear with me on this one as it is my first WP plugin for like a decade and the first ever to be shared so i kept it quite basic.<\/p>\n\n<p>How it works:<\/p>\n\n<ul>\n<li>On each menu item that is either a category or a page you get an option to automatically append their children as a submenu<\/li>\n<li>You get to decide how many children to show and how they're gonna be ordered (Title or Date)<\/li>\n<li>And that's it, all you have to do is create content and never worry about your menu again.<\/li>\n<li>As promised, it doesn't mess with the theme or other plugins, it just injects the children found in the corresponding place of the nav menu array when that is triggered in the frontend<\/li>\n<\/ul>\n\n<h3>Code hacks<\/h3>\n\n<p>There is no settings page for the plugin but you can change a couple default behaviours from the code itself<\/p>\n\n<h4>Changing the default maximum children number when the field is empty<\/h4>\n\n<pre><code>$item-&gt;automatic_max = 5; just change the number at line 220\n<\/code><\/pre>\n\n<h4>Bring only direct children of Pages and not all ascendants<\/h4>\n\n<pre><code>$children = get_pages( array( 'child_of' =&gt; $item-&gt;object_id, 'number' =&gt; $item-&gt;automatic_max, 'sort_column' =&gt; 'post_'.$ordering[0], 'sort_order' =&gt; strtoupper( $ordering[1] ) ) ); just change 'child_of' to 'parent' at line 226\n<\/code><\/pre>\n\n<p>Upcoming Features:<\/p>\n\n<p>Due to lack of time i will implement the following features upon demand. Please post your requests in the forum.<\/p>\n\n<ul>\n<li>Settings Page<\/li>\n<li>Submenu items ordering<\/li>\n<li>Support for custom post types and taxonomies<\/li>\n<\/ul>\n\n<p>Credits:<\/p>\n\n<ul>\n<li>I have used the menu walker created by zviryatko (https:\/\/plugins.trac.wordpress.org\/browser\/menu-image\/trunk\/menu-image.php)<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Plain and simple<\/p>\n\n<ol>\n<li>Upload the plugin folder to the <code>\/wp-content\/plugins\/<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<li>Go to Appearance-&gt;Menu and config each menu item as you like<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><p>Plain and simple<\/p>\n\n<ol>\n<li>Upload the plugin folder to the <code>\/wp-content\/plugins\/<\/code> directory, or install the plugin through the WordPress plugins screen directly.<\/li>\n<li>Activate the plugin through the 'Plugins' screen in WordPress<\/li>\n<li>Go to Appearance-&gt;Menu and config each menu item as you like<\/li>\n<\/ol><\/dd>\n<dt>Is there a limit on the submenus I can have the children automatically populated<\/dt>\n<dd><p>No, you can have it enabled on whatever category or page manu you like, no matter how many or how deep they are in your menu structure<\/p><\/dd>\n<dt>I saved my menu but I don't see the children added in the menu editor<\/dt>\n<dd><p>Yes that is correct, the children are shown only in the front-end of your website else you would have problems when saving your menu.<\/p><\/dd>\n<dt>Can I change the ordering of the added children regarding manually added submenu items?<\/dt>\n<dd><p>No, currently you cannot. All automatic children will be appended (added to the end) of the submenu. Leave a request on the forum if you would like this feature.<\/p><\/dd>\n<dt>Can I use this plugin with custom post types and taxonomies?<\/dt>\n<dd><p>No, currently you cannot. It works with pages and posts assigned to a category. Leave a request on the forum if you would like this feature.<\/p><\/dd>\n<dt>Can i use this plugin along with another menu altering plugin (e.g. megamenu) ?<\/dt>\n<dd><p>Yes, all this plugin does is inject items to the nav menu array for the front-end. It doesn't affect the rendering of the menu. Nonetheless; I cannot guarantee the behaviour of third-party menu plugins which rely on custom post types other than nav_menu_item.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Automatically append children posts and pages as submenu items in the frontend","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/77567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=77567"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/rallisf1"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=77567"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=77567"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=77567"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=77567"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=77567"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=77567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}