$gr_preview_theme = $_GET[\'preview_theme\'];
$gr_preview_css = $_GET[\'preview_css\'];
if (! $gr_preview_css )
$gr_preview_css = $gr_preview_theme;
if($gr_preview_theme && file_exists(get_theme_root() . "/$gr_preview_theme")) {
add_filter(\'template\',\'use_preview_theme\');
}
if($gr_preview_css && file_exists(get_theme_root() . "/$gr_preview_css")) {
add_filter(\'stylesheet\',\'use_preview_css\');
}
function use_preview_theme($themename) {
global $gr_preview_theme;
return $gr_preview_theme;
}
function use_preview_css($cssname) {
global $gr_preview_css;
return $gr_preview_css;
}
pludgin的代码太小。我想把代码放到主题函数中。php文件。我可以这样做吗?
add_filter(\'template\',\'use_preview_theme\');
上面这一行是什么意思?它有什么用?非常感谢。