{"id":17385,"date":"2012-03-21T21:56:31","date_gmt":"2012-03-21T21:56:31","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/menu-rules\/"},"modified":"2012-12-17T22:44:56","modified_gmt":"2012-12-17T22:44:56","slug":"menu-rules","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/menu-rules\/","author":7340004,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.2","stable_tag":"1.2.2","tested":"3.5.2","requires":"3.2","requires_php":"","requires_plugins":"","header_name":"Menu rules","header_author":"Phill Brown","header_description":"","assets_banners_color":"9d7d59","last_updated":"2012-12-17 22:44:56","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/pbweb.co.uk\/donate","header_plugin_uri":"","header_author_uri":"http:\/\/pbweb.co.uk","rating":0,"author_block_rating":0,"active_installs":10,"downloads":8852,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.2.2":"<p>Menu Rules has been superseded by Context Manager - more features, less coding. This plugin is being deprecated.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"625921","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.2.1","1.2.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2681,1865,231,20099,20095],"plugin_category":[43],"plugin_contributors":[87691],"plugin_business_model":[],"class_list":["post-17385","plugin","type-plugin","status-publish","hentry","plugin_tags-context","plugin_tags-menu","plugin_tags-menus","plugin_tags-parent-menu","plugin_tags-rules","plugin_category-customization","plugin_contributors-phill_brown","plugin_committers-phill_brown"],"banners":{"banner":"https:\/\/ps.w.org\/menu-rules\/assets\/banner-772x250.png?rev=625921","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/menu-rules_9d7d59.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p><strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/context-manager\/\">This plugin has been replaced by Context Manager<\/a><\/strong><\/p>\n\n<p>Context Manager does the same job as Menu Rules, but comes with many more features to save you time and unnecessary coding.<\/p>\n\n<p>Menu Rules can run alongside Context Manager while you migrate your rules across. <a href=\"http:\/\/twitter.com\/phill_brown\">Speak to me on Twitter<\/a> if you need any help with the transfer.<\/p>\n\n<h4>About Menu Rules<\/h4>\n\n<p>In WordPress there's no way to apply context to the menu system. Menu Rules solves this problem and gives you a framework to write your own menu extensions.<\/p>\n\n<h4>Example usage<\/h4>\n\n<p>You have an e-commerce website that has a custom post type called 'products'. You have a page that lists products which is listed in your main menu. A user visits the page and the menu item becomes 'active'. You click through to a product and the menu item loses its active state. This is how to fix it with menu rules:<\/p>\n\n<ol>\n<li><a href=\"http:\/\/wordpress.org\/extend\/plugins\/menu-rules\/installation\/\">Install<\/a> the Menu Rules plugin<\/li>\n<li>Add a menu rule<\/li>\n<li>Give it a meaningful name in the title field. This is just for administration purposes<\/li>\n<li>In the conditions field enter <code>is_singular( 'product' )<\/code><\/li>\n<li>Choose <em>Emulate current page as a child but do not create a menu item.<\/em> as the menu rule<\/li>\n<li>Find your products page in the menu dropdown<\/li>\n<li>Hit publish<\/li>\n<\/ol>\n\n<h4>Extending Menu Rules<\/h4>\n\n<ol>\n<li>Create a class that extends <code>Menu_Rules_Handler<\/code> and includes a <code>handler<\/code> method.<\/li>\n<li>Write your custom functionality<\/li>\n<li>Register your class using <code>add_action( 'plugins_loaded', create_function( '', 'Menu_Rules::register( \"Your_Menu_Rule_Class\" );' ) );<\/code><\/li>\n<\/ol>\n\n<p>Built-in rules are found in <code>menu-rules\/rules\/<\/code><\/p>\n\n<h4>Support<\/h4>\n\n<p>If you're stuck, ask me for help on <a href=\"http:\/\/twitter.com\/phill_brown\">Twitter<\/a>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Download and unzip the folder from <a href=\"http:\/\/wordpress.org\/extend\/plugins\/menu-rules\/\">the WordPress plugins repository<\/a><\/li>\n<li>Upload the menu-rules folder into to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Open the 'Appearance' menu item and click the 'Menu Rules' link<\/li>\n<li>Add a new menu rule and click ok.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.2.2<\/h4>\n\n<ul>\n<li>Upgrade notice to Context Manager<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>Fixed fatal bug in PHP 5.4<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Conditions and Reactions divided into 2 meta boxes to improve usability<\/li>\n<li>Theme improvements<\/li>\n<li>Added <em>description<\/em> and <em>footer<\/em> options to PB Framework forms<\/li>\n<li>Moved plugin meta box styles into PB Framework<\/li>\n<li>Added default meta box display in PB Framework<\/li>\n<li>Added field setter for PB Framework meta box class<\/li>\n<li>Bugfix where frontend assets weren't being loaded when on a new menu rule<\/li>\n<li>Bugfix in meta box get_fields()<\/li>\n<li>Bugfix for post updated messages<\/li>\n<\/ul>\n\n<p><strong>Note:<\/strong> Some stylesheets and Javascript files have had their handles changed.<\/p>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Added new <em>force inactive parent<\/em> rule<\/li>\n<li>Changed behaviour to one rule per item<\/li>\n<li>Minor enhancements to PB Framework<\/li>\n<li>Cleaned some unused code<\/li>\n<\/ul>","raw_excerpt":"An extension of the menu system with context-based rules and a flexible framework to write your own.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/17385","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=17385"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/phill_brown"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=17385"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=17385"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=17385"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=17385"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=17385"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=17385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}