{"id":21151,"date":"2012-12-15T14:39:16","date_gmt":"2012-12-15T14:39:16","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/context-manager\/"},"modified":"2013-11-13T16:21:01","modified_gmt":"2013-11-13T16:21:01","slug":"context-manager","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/context-manager\/","author":7340004,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.0","stable_tag":"1.2.0","tested":"3.7.41","requires":"3.2","requires_php":"","requires_plugins":"","header_name":"Context Manager","header_author":"Phill Brown","header_description":"","assets_banners_color":"735b3e","last_updated":"2013-11-13 16:21:01","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/pbweb.co.uk\/donate","header_plugin_uri":"","header_author_uri":"http:\/\/pbweb.co.uk","rating":5,"author_block_rating":0,"active_installs":20,"downloads":4657,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"6"},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"640097","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1","1.0.2","1.1","1.1.1","1.1.2","1.1.3","1.1.4","1.1.5","1.2.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"639694","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"640080","resolution":"2","location":"assets"}},"screenshots":{"1":"An example setup for a products section in a online shop","2":"CSS and JavaScript reactions"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2681,20095,20096,20094,20093],"plugin_category":[43],"plugin_contributors":[87691],"plugin_business_model":[],"class_list":["post-21151","plugin","type-plugin","status-publish","hentry","plugin_tags-context","plugin_tags-rules","plugin_tags-widget-logic","plugin_tags-wp_enqueue_scripts","plugin_tags-wp_enqueue_styles","plugin_category-customization","plugin_contributors-phill_brown","plugin_committers-phill_brown"],"banners":{"banner":"https:\/\/ps.w.org\/context-manager\/assets\/banner-772x250.png?rev=640097","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/context-manager_735b3e.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/context-manager\/assets\/screenshot-1.png?rev=639694","caption":"An example setup for a products section in a online shop"},{"src":"https:\/\/ps.w.org\/context-manager\/assets\/screenshot-2.png?rev=640080","caption":"CSS and JavaScript reactions"}],"raw_content":"<!--section=description-->\n<p>Context Manager makes your site behave differently depending on the current user's context. Using the simple point-and-click admin pages, there are four different ways your site can react:<\/p>\n\n<ol>\n<li>Include and exclude CSS and JavaScript files<\/li>\n<li>Changing the behaviour of menu items<\/li>\n<li>Hiding widgets in sidebars<\/li>\n<li>Adding extra classes to the <code>&lt;body&gt;<\/code> tag.<\/li>\n<\/ol>\n\n<p>The plugin supersedes <a href=\"http:\/\/wordpress.org\/extend\/plugins\/menu-rules\/\">Menu Rules<\/a><\/p>\n\n<h4>Example usage<\/h4>\n\n<p>A website has e-commerce shopping functionality driven by a custom post type called 'products'. There's an archive page called 'shop' that lists products and is linked to in the main navigation menu.<\/p>\n\n<p>A user visits 'shop' and the menu item becomes 'active', but when they click through to an individual product, the menu item loses its state. The user becomes lost.<\/p>\n\n<ol>\n<li><a href=\"http:\/\/wordpress.org\/extend\/plugins\/context-manager\/installation\/\">Install<\/a> the Context Manager plugin<\/li>\n<li>Add a new context rule<\/li>\n<li>Give it a meaningful name in the title field. This is just for administration purposes<\/li>\n<li>In the <em>conditions<\/em> 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<\/ol>\n\n<p>On the product page, there are irrelevant widgets that distract the user from making a purchase.<\/p>\n\n<ul>\n<li>Hide irrelevant widgets under the <em>widgets<\/em> reaction<\/li>\n<\/ul>\n\n<p>The whole shop section requires its own colour scheme, but there's no common class that ties all the pages together.<\/p>\n\n<ul>\n<li>Enter <code>shop-section<\/code> class name in the <em>body class<\/em> reaction. Or alternatively, register another stylesheet using <a href=\"http:\/\/codex.wordpress.org\/Function_Reference\/wp_register_style\"><code>wp_register_style()<\/code><\/a> in you theme's <code>functions.php<\/code>.<\/li>\n<li>Create <\/li>\n<\/ul>\n\n<p>Remember to click publish when you're ready to save.<\/p>\n\n<p>Have a look at <a href=\"http:\/\/wordpress.org\/extend\/plugins\/context-manager\/screenshots\/\">screenshots<\/a> to see the above setup in action.<\/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\/context-manager\/\">the WordPress plugins repository<\/a><\/li>\n<li>Upload the context-manager 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 'Context Rules' link<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>[Bugfix]: disabled assets reaction which triggered errors in 3.6. No feasible workaround found yet<\/li>\n<li>[Bugfix]: added conditional checks into widgets reaction<\/li>\n<\/ul>\n\n<h4>1.1.5<\/h4>\n\n<ul>\n<li>[Bugfix]: menu_reaction property not being set in child page and inactive parent menu reactions<\/li>\n<\/ul>\n\n<h4>1.1.4<\/h4>\n\n<ul>\n<li>[Bugfix]: Some environments were triggering a fatal error related to html() due to an action being added to a hook too late<\/li>\n<\/ul>\n\n<h4>1.1.3<\/h4>\n\n<ul>\n<li>[Bugfix]: Asset reaction generating a global site error if not logged in<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>[Bugfix]: Major issue that generated an error when adding or editing a context rule<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>[Bugfix]: Errors in widget reaction when site has orphaned widgets <\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>[Added]: Assets reaction<\/li>\n<li>[Bugfix]: get_rules() using incorrect meta_query parameter<\/li>\n<li>[Bugfix]: PHP 5.4 fatal errors<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>[Bugfix]: Body class and widget reactions caused an error when no rules were set up<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>[Bugfix]: Invalid foreach warning when no rules were added in get_rules()<\/li>\n<\/ul>","raw_excerpt":"Make your site react to users&#039; context by changing your theme&#039;s CSS and JavaScript files, navigation menus, sidebars and the HTML body tag.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/21151","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=21151"}],"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=21151"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=21151"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=21151"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=21151"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=21151"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=21151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}