{"id":28051,"date":"2014-02-25T22:43:06","date_gmt":"2014-02-25T22:43:06","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/domain-name-autoswitch\/"},"modified":"2014-06-14T14:22:14","modified_gmt":"2014-06-14T14:22:14","slug":"domain-name-autoswitch","status":"publish","type":"plugin","link":"https:\/\/pap-aw.wordpress.org\/plugins\/domain-name-autoswitch\/","author":13689843,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2.4","stable_tag":"trunk","tested":"3.9.40","requires":"","requires_php":"","requires_plugins":"","header_name":"Domain Name Autoswitch","header_author":"Benjamin Menant <dev@menant-benjamin.fr>","header_description":"","assets_banners_color":"","last_updated":"2014-06-14 14:22:14","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"http:\/\/menant-benjamin.fr\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":2456,"num_ratings":0,"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":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.2","1.2.1","1.2.2","1.2.3","1.2.4"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[4962,24451],"plugin_category":[],"plugin_contributors":[93578],"plugin_business_model":[],"class_list":["post-28051","plugin","type-plugin","status-publish","hentry","plugin_tags-front-page","plugin_tags-multi-domain-name","plugin_contributors-bmenant","plugin_committers-bmenant"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/domain-name-autoswitch.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Here is a useful method you should use any where you need it <code>dnas_get_post_ID()<\/code>.<\/p>\n\n<p>It returns the post ID (if any) related to the current domain name.\nFor instance, if you would like to display URL of the fake home page:\n    <\/p>\n\n<p>You can check the plugin development on <a href=\"https:\/\/github.com\/bmenant\/wordpress-domain-name-autoswitch\">github<\/a>.<\/p>\n\n<p><strong>Pros:<\/strong><\/p>\n\n<ul>\n<li>since the plugin does not modify nor use your <code>.htaccess<\/code> file,\nit works with every permalink formats.<\/li>\n<li>allow you to manage your domain names directly through your\npost edit forms.<\/li>\n<\/ul>\n\n<p><strong>Cons:<\/strong><\/p>\n\n<ul>\n<li>since it hacks the query variables, some template tags like <code>is_home()<\/code>\ncould not work as expected if a dedicated domain name is triggered.<\/li>\n<li>be aware there is no conflict support: you can fill the same domain\nfor several posts. Only a single one will win the game, without\nany control from your part (but it will be easy to see which one have\nto be checked\u2026 if you ever notice it). Be careful!<\/li>\n<\/ul>\n\n<h4>Configuration<\/h4>\n\n<p>The plugin <strong>works with both custom post types and classic post type<\/strong>.\nYou have to edit a configuration file in order to indicate on which\nposts the plugin should add its domain name field. You can indicate\n<strong>Categorie identifiers or\/and Post Types<\/strong> slugs. For instance, to make\nthe plugin showing its domain field on any posts of the categories #4\nand #8, then:<\/p>\n\n<pre><code>$dnas_categories_ID = array( 4, 8 );\n<\/code><\/pre>\n\n<h4>Dependency<\/h4>\n\n<p>The <a href=\"http:\/\/wordpress.org\/plugins\/advanced-custom-fields\">Advanced Custom Fields<\/a>\nplugin is required.<\/p>\n\n<h4>License<\/h4>\n\n<p>This program is free software. It comes without any warranty, to\nthe extent permitted by applicable law. You can redistribute it\nand\/or modify it under the terms of the <a href=\"http:\/\/www.wtfpl.net\/txt\/copying\/\">Do What The Fuck You Want\nTo Public License, Version 2<\/a>,\nas published by Sam Hocevar. See (http:\/\/www.wtfpl.net\/) for more details.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>First, unzip or upload the plugin into <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>In the plugin directory, edit the following file:\n    sample-domain-name-autoswitch-config.php.<\/li>\n<li>Then, rename the config file to: <code>domain-name-autoswitch-config.php<\/code>.<\/li>\n<li>Activate the plugin through the WordPress Plugins admin page.<\/li>\n<li>Set up your domain names like you want to, directly through the\nposts\u2019 edit pages.<\/li>\n<li>Obviously, you will have to set up your virtual hosts (<code>ServerAlias<\/code>\ndirectives), so every domain names you want to use are pointing to\nyour WordPress instance.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.2.4<\/h4>\n\n<ul>\n<li>Fix the way settings are saved: from now, settings are not erased after upgrading the plugin.<\/li>\n<\/ul>\n\n<h4>1.2.3<\/h4>\n\n<ul>\n<li>Fix SQL syntax when using custom post type identifiers.<\/li>\n<li>Add license details.<\/li>\n<\/ul>\n\n<h4>1.2.2<\/h4>\n\n<ul>\n<li>Add the <code>dnas_get_post_ID()<\/code> global function.<\/li>\n<li>Enhance the readme.txt.<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>Add the get_post_ID() method to the class.<\/li>\n<li>Fix an issue with permalink: now hooks the permalinks values.\nFor instance, the canonical meta link now displays the dedicated domain name.<\/li>\n<li>Fix a singleton issue (public constructor).<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>First stable release.<\/li>\n<li>Handle posts by categories or by post types.<\/li>\n<\/ul>","raw_excerpt":"Add a domain name field to the posts\u2019 edit pages you have selected (through category and\/or post type identifiers). Allow each post to have its own do &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/28051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=28051"}],"author":[{"embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/bmenant"}],"wp:attachment":[{"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=28051"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=28051"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=28051"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=28051"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=28051"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pap-aw.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=28051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}