Created
May 10, 2011 19:39
-
-
Save miya0001/965215 to your computer and use it in GitHub Desktop.
switch theme class for wordpress plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class switchTheme { | |
private $name = null; | |
private $dir = null; | |
private $url = null; | |
function __construct($name = null, $dir = null, $url = null) | |
{ | |
$this->name = $name; | |
$this->dir = $dir; | |
$this->url = $url; | |
add_filter("show_admin_bar", "__return_false"); | |
add_filter("stylesheet", array(&$this, "template")); | |
add_filter("template", array(&$this, "template")); | |
add_filter("theme_root", array(&$this, "theme_root")); | |
add_filter("theme_root_uri", array(&$this, "theme_root_uri")); | |
} | |
public function template($name) | |
{ | |
if ($this->name) { | |
return $this->name; | |
} else { | |
return $name; | |
} | |
} | |
public function theme_root($dir) | |
{ | |
if ($this->dir) { | |
return $this->dir; | |
} else { | |
return $dir; | |
} | |
} | |
public function theme_root_uri($url) | |
{ | |
if ($this->url) { | |
return $this->url; | |
} else { | |
return $url; | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
詳細は以下のページで。
http://firegoby.theta.ne.jp/archives/2251