{"id":151400,"date":"2021-12-22T10:47:10","date_gmt":"2021-12-22T10:47:10","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/set-the-stage\/"},"modified":"2023-08-16T19:49:51","modified_gmt":"2023-08-16T19:49:51","slug":"set-the-stage","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/set-the-stage\/","author":363336,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.1","stable_tag":"1.0.1","tested":"6.3.8","requires":"4.7","requires_php":"7.4","requires_plugins":null,"header_name":"Set the Stage","header_author":"Ivaylo Draganov","header_description":"Quickly switch between environments (live, test, dev) from the admin bar.","assets_banners_color":"dddfe1","last_updated":"2023-08-16 19:49:51","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/dragunoff\/wp-stage-switcher\/","header_author_uri":"https:\/\/dragunoff.github.io\/","rating":5,"author_block_rating":0,"active_installs":10,"downloads":3425,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"dragunoff","date":"2022-01-26 15:59:46"},"1.0.1":{"tag":"1.0.1","author":"dragunoff","date":"2023-08-16 19:49:51"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":1},"assets_icons":[],"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2647750,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2647750,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2647750,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":2647750,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":2647750,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"The admin bar menu in action","2":"The settings page","3":"Adding the current environment to the list"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[7318,1865,19980,1140],"plugin_category":[43],"plugin_contributors":[206108],"plugin_business_model":[],"class_list":["post-151400","plugin","type-plugin","status-publish","hentry","plugin_tags-environment","plugin_tags-menu","plugin_tags-stage","plugin_tags-switcher","plugin_category-customization","plugin_contributors-dragunoff","plugin_committers-dragunoff"],"banners":{"banner":"https:\/\/ps.w.org\/set-the-stage\/assets\/banner-772x250.png?rev=2647750","banner_2x":"https:\/\/ps.w.org\/set-the-stage\/assets\/banner-1544x500.png?rev=2647750","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/set-the-stage_dddfe1.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/set-the-stage\/assets\/screenshot-1.png?rev=2647750","caption":"The admin bar menu in action"},{"src":"https:\/\/ps.w.org\/set-the-stage\/assets\/screenshot-2.png?rev=2647750","caption":"The settings page"},{"src":"https:\/\/ps.w.org\/set-the-stage\/assets\/screenshot-3.png?rev=2647750","caption":"Adding the current environment to the list"}],"raw_content":"<!--section=description-->\n<p>Adds a menu to the admin bar to quickly identify different environments for a site (e.g. production and development) and easily switch to the same URL on other environments. Multi-site compatible for both sub-domain and sub-directory installations.<\/p>\n\n<h3>Configuration<\/h3>\n\n<p>The plugin has a convenient settings page but can also be configured programatically via a filter hook.<\/p>\n\n<h4>Setting environments via the WordPress admin interface<\/h4>\n\n<p>Navigate to \"Settings &gt; Set the Stage\" in the WordPress admin to review and edit the configuration.<\/p>\n\n<h4>Setting environments via a WordPress filter hook<\/h4>\n\n<p>Hook to <code>drgnff_wp_stage_switcher__environments<\/code> and return an array with environments. Here's an example filter function:<\/p>\n\n<pre><code>add_filter( 'drgnff_wp_stage_switcher__environments', function ($envs) {\n    return [\n        [\n            'url' =&gt; 'https:\/\/example.com', \/\/ home url\n            'title' =&gt; 'LIVE', \/\/ display name\n            'color' =&gt; '#ffffff', \/\/ hex color (optional)\n            'background_color' =&gt; '#ff0000', \/\/ hex color (optional)\n        ],\n        [\n            'url' =&gt; 'https:\/\/example.com',\n            'title' =&gt; 'DEVELOPMENT',\n            'color' =&gt; '#ffffff',\n            'background_color' =&gt; '#228b22',\n        ],\n    ];\n});\n<\/code><\/pre>\n\n<h4>Controlling visibility of the switcher<\/h4>\n\n<p>By default the switcher menu is displayed to all logged in users. By hooking to <code>drgnff_wp_stage_switcher__should_display_switcher<\/code> and returning a boolean you can control whether the switcher should be displayed.<\/p>\n\n<h4>Overriding the default environment<\/h4>\n\n<p>The default environment is used for the current site if it's not in the list of environments. By hooking to <code>drgnff_wp_stage_switcher__default_environment<\/code> you can control the title and colors for the default environment.<\/p>\n\n<h4>A few notes on configuration<\/h4>\n\n<ul>\n<li>Filters have a precedence over manual configuration made in the settings page. If filters are used then relevant sections on the settings page are rendered as read-only.<\/li>\n<li>For multi-site installations use the URLs of the main site.<\/li>\n<li>The plugin initiates its logic on the <code>plugins_loaded<\/code> hook with priority <code>11<\/code>. Thus filter hooks that affect the plugin must be added before that.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Activate from the plugins menu.<\/li>\n<li>Navigate to the plugin settings page or use a filter to set up your environments.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<p><strong>Fixed<\/strong>\n- Fix default environment reset button<\/p>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Quickly switch between environments (live, test, dev) from the admin bar.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/151400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=151400"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dragunoff"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=151400"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=151400"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=151400"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=151400"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=151400"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=151400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}