Domain Name Autoswitch

Add a domain name field to posts’ form, so each post can have its own domain name and can be displayed as a front page.

Author:Benjamin Menant (profile at wordpress.org)
WordPress version required:3.5.x
WordPress version tested:3.9.40
Plugin version:1.2.4
Added to WordPress repository:25-02-2014
Last updated:14-06-2014
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:0
Rated by:0
Plugin URI:
Total downloads:1 320
Active installs:10+
plugin download
Click to start download

Here is a useful method you should use any where you need it dnas_get_post_ID().

It returns the post ID (if any) related to the current domain name.
For instance, if you would like to display URL of the fake home page:

You can check the plugin development on github.

Pros:

  • since the plugin does not modify nor use your .htaccess file,
    it works with every permalink formats.
  • allow you to manage your domain names directly through your
    post edit forms.

Cons:

  • since it hacks the query variables, some template tags like is_home()
    could not work as expected if a dedicated domain name is triggered.
  • be aware there is no conflict support: you can fill the same domain
    for several posts. Only a single one will win the game, without
    any control from your part (but it will be easy to see which one have
    to be checked… if you ever notice it). Be careful!

Configuration

The plugin works with both custom post types and classic post type.
You have to edit a configuration file in order to indicate on which
posts the plugin should add its domain name field. You can indicate
Categorie identifiers or/and Post Types slugs. For instance, to make
the plugin showing its domain field on any posts of the categories #4
and #8, then:

$dnas_categories_ID = array( 4, 8 );

Dependency

The Advanced Custom Fields
plugin is required.

License

This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2
,
as published by Sam Hocevar. See (http://www.wtfpl.net/) for more details.


ChangeLog