{"id":23244,"date":"2013-05-09T13:57:08","date_gmt":"2013-05-09T13:57:08","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/advanced-custom-fields-nav-menu-field\/"},"modified":"2014-10-15T05:33:27","modified_gmt":"2014-10-15T05:33:27","slug":"advanced-custom-fields-nav-menu-field","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/advanced-custom-fields-nav-menu-field\/","author":10115776,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.0.0","stable_tag":"2.0.0","tested":"4.0.38","requires":"3.4","requires_php":"","requires_plugins":"","header_name":"Advanced Custom Fields: Nav Menu Field","header_author":"Faison Zutavern","header_description":"","assets_banners_color":"fdfdfd","last_updated":"2017-11-28 12:59:28","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/faisonz.com\/wordpress-plugins\/advanced-custom-fields-nav-menu-field\/","header_author_uri":"http:\/\/faisonz.com","rating":5,"author_block_rating":0,"active_installs":8000,"downloads":135953,"num_ratings":33,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"2.0.0":"<p>You now have support for ACF v5, and when the code is read, it makes fewer people cry!<\/p>","1.1.1":"<p>I forgot to add a default value for the Menu Container field. So to eliminate WP_DEBUG warnings, I added &#039;div&#039; as the default value. Please upgrade to avoid the warnings.<\/p>","1.1.0":"<p>Added a new minor feature for selecting the Menu&#039;s containing element.<\/p>","1.0.0":"<p>If you have a version less than 0.1.0, something went really, really wrong. Upgrade now, because I have no idea what will happen if you don&#039;t!<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":1,"5":31},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"733149","resolution":"772x250","location":"assets","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.1.1","1.1.2","2.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"710656","resolution":"1","location":"assets","width":1180,"height":773},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"710656","resolution":"2","location":"assets","width":810,"height":440},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"710656","resolution":"3","location":"assets","width":870,"height":590},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"710656","resolution":"4","location":"assets","width":880,"height":235}},"screenshots":{"1":"<p>Adding the Nav Menu Field to an Advanced Custom Fields Field Group<\/p>","2":"<p>Creating your menu in the WordPress Admin backend<\/p>","3":"<p>Selecting the previously created menu in the meta box created by Advanced Custom Fields<\/p>","4":"<p>Viewing the (not styled) menu displayed by calling 'the_field()' in the sidebar<\/p>"}},"plugin_section":[],"plugin_tags":[2211,2292,4603,2217,2010],"plugin_category":[43,59],"plugin_contributors":[79352],"plugin_business_model":[],"class_list":["post-23244","plugin","type-plugin","status-publish","hentry","plugin_tags-acf","plugin_tags-acf4","plugin_tags-acf5","plugin_tags-advanced-custom-fields","plugin_tags-custom-fields","plugin_category-customization","plugin_category-utilities-and-tools","plugin_contributors-faison","plugin_committers-faison"],"banners":{"banner":"https:\/\/ps.w.org\/advanced-custom-fields-nav-menu-field\/assets\/banner-772x250.png?rev=733149","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/advanced-custom-fields-nav-menu-field_fdfdfd.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/advanced-custom-fields-nav-menu-field\/assets\/screenshot-1.png?rev=710656","caption":"<p>Adding the Nav Menu Field to an Advanced Custom Fields Field Group<\/p>"},{"src":"https:\/\/ps.w.org\/advanced-custom-fields-nav-menu-field\/assets\/screenshot-2.png?rev=710656","caption":"<p>Creating your menu in the WordPress Admin backend<\/p>"},{"src":"https:\/\/ps.w.org\/advanced-custom-fields-nav-menu-field\/assets\/screenshot-3.png?rev=710656","caption":"<p>Selecting the previously created menu in the meta box created by Advanced Custom Fields<\/p>"},{"src":"https:\/\/ps.w.org\/advanced-custom-fields-nav-menu-field\/assets\/screenshot-4.png?rev=710656","caption":"<p>Viewing the (not styled) menu displayed by calling 'the_field()' in the sidebar<\/p>"}],"raw_content":"<!--section=description-->\n<p>Add <a href=\"http:\/\/codex.wordpress.org\/Navigation_Menus\">Navigation Menus<\/a> to <a href=\"http:\/\/wordpress.org\/extend\/plugins\/advanced-custom-fields\/\">Advanced Custom Fields<\/a> (ACF) with the Nav Menu Field plugin! This plugin adds the Nav Menu Field type to ACF (version 5 &amp; 4), allowing you to select from the menus you create in the WordPress Admin backend to use on your website's frontend.<\/p>\n\n<p>Using ACF, you can set the Nav Menu Field to return the selected menu's:<\/p>\n\n<ul>\n<li>ID for lightweight coding,<\/li>\n<li>Object for more involved programming, or<\/li>\n<li>HTML (generated from <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_nav_menu\">wp_nav_menu<\/a>) for quickly displaying a menu.<\/li>\n<\/ul>\n\n<p>I created this plugin because I needed to display a secondary menu that changed depending on what page you're on. Most of those pages were children of the same page, but then I had to throw a couple of Custom Post Types in there too. Because of the Custom Post Types, I couldn't just grab the top most parent for the current page and use <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_list_pages\">wp_list_pages<\/a>. So I did some research and decided to extend the functionality of my favourite plugin, <a href=\"http:\/\/wordpress.org\/extend\/plugins\/advanced-custom-fields\/\">Advanced Custom Fields<\/a>. Now when I create a new Page or Custom Post, I just select the menu from a drop down menu!<\/p>\n\n<p>Feel free to try this add-on on your dev site, ask questions on the support link above, and please review this add-on. By leaving a rating and review, you help this plugin become even better!<\/p>\n\n<h4>Advanced Custom Fields Compatibility<\/h4>\n\n<p>This add-on will work with:<\/p>\n\n<ul>\n<li>version 5<\/li>\n<li>version 4<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>Follow the following instructions: https:\/\/codex.wordpress.org\/Managing_Plugins#Installing_Plugins<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><p>Follow the following instructions: https:\/\/codex.wordpress.org\/Managing_Plugins#Installing_Plugins<\/p><\/dd>\n<dt>Can you show a quick example of how to use this?<\/dt>\n<dd><p>Sure can!<\/p>\n\n<ol>\n<li>Create a new field group<\/li>\n<li>Add a Nav Menu and set the Field Label to <code>Side Menu<\/code> (this will cause the Field Name to be <code>side_menu<\/code>)<\/li>\n<li>Set the Nav Menu's Return Value to <code>Nav Menu HTML<\/code><\/li>\n<li>Set the Location Rules to Show if \"Post Type\" \"is equal to\" \"Page\"<\/li>\n<li>Save the Field Group<\/li>\n<li><p>Now in your themes sidebar.php, put the following code before or after any of the div's with class=\"widget-area\"<\/p>\n\n<p>\n    \n        \n    \n<\/p><\/li>\n<\/ol>\n\n<p>Finally, create or edit a page, select a menu in the Side Menu field, and view the page to see that menu in the sidebar!<\/p><\/dd>\n<dt>Will you make this plugin compatible with Advanced Custom Fields v3?<\/dt>\n<dd><p>No.<\/p><\/dd>\n<dt>Why does the Nav Menu returned by your plugin look like an unstyled list of links?<\/dt>\n<dd><p>So that you can style it yourself. I don't want to step on your toes :)<\/p><\/dd>\n<dt>I added the Nav Menu Field to Pages, selected my menu when creating a new page, but the menu doesn't show. What gives?<\/dt>\n<dd><p>First, check that you added the necessary ACF code to your templates. If you don't know what I'm talking about, read up on how to use <a href=\"http:\/\/wordpress.org\/extend\/plugins\/advanced-custom-fields\/\">Advanced Custom Fields<\/a>. If you're already familiar with ACF and you still can't figure out why the menu isn't showing up, start a new support thread, include details and a little code, and I'll do my best to help you.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Added ACF v5 class.<\/li>\n<li>Updated code to follow coding standards<\/li>\n<li>Updated the ACF v4 class to use the updated code found in the ACF v5 Class<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Fixed a silly mistake related to allowing Null for a Nav Menu Field. Basically, it was storing the string \"null\" when you don't select a menu, that's taken care of now.<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>I forgot to add a default value for the Menu Container field, so I added 'div' as the default value. If you upgraded from 1.0.0 to 1.1.0 and had WP_DEBUG enabled, you would receive a warning about an unknown index. Since I like debug mode to run without warnings, I fixed this.<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Added a field which allows users to choose the containing element for the Menu's ul. See <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_nav_menu#Parameters\">wp_nav_menu's container parameter<\/a><\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial Release.<\/li>\n<\/ul>","raw_excerpt":"Add-On plugin for Advanced Custom Fields (ACF) that adds a &#039;Nav Menu&#039; Field type.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/23244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=23244"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/faison"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=23244"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=23244"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=23244"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=23244"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=23244"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=23244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}