Created
July 1, 2014 17:35
-
-
Save snoise/163d64a0bc8f78f98bd8 to your computer and use it in GitHub Desktop.
スマホ・モバイル用にテーマを別設定するプラグイン(3/3)。#WordPressプラグイン
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 Paka3_theme_switch { | |
private $name ; | |
function __construct($name = null) { | |
$this->name = $name; | |
add_filter("show_admin_bar", "__return_false"); | |
add_filter("stylesheet", array($this, "template")); | |
add_filter("template", array($this, "template")); | |
} | |
public function template($name) { | |
$template_name = $this->name ? $this->name : $name; | |
return $template_name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment