将文件从插件目录复制到主题目录

时间:2016-02-02 14:05:44

标签: wordpress plugins copy

我需要将我的插件目录中的两个文件复制到主题目录。我试过这个

IsEditable = True

但是,我只能将function plugin_to_theme_dir() { $plugin_dir = plugin_dir_path(__FILE__) . 'folder/one.php'; $plugin_dir = plugin_dir_path(__FILE__) . 'folder/two.php'; $theme_dir = get_template_directory() . '/one.php'; $theme_dir = get_template_directory() . '/two.php'; if (!copy($plugin_dir, $theme_dir)) { echo "failed to copy $plugin_dir to $theme_dir...\n"; } } add_action('init', 'plugin_to_theme_dir'); 文件复制到主题目录而不是另一个。我需要复制这两个。我怎么能这样做?

来源:https://wordpress.stackexchange.com/questions/145254/copy-a-file-from-a-plugin-into-my-theme-directory/145298#145298

0 个答案:

没有答案