我想在插件激活时在wordpress中移动文件。我为此编写了一个代码,但它无法正常工作。
function onactivation_install(){
$src = ABSPATH . 'wp-content/plugins/sinetiks-schools/plugin_list.php';
$dest = get_template_directory();
$full_path = $dest.'/';
$flag = wp_handle_upload($src,$full_path);
var_dump($flag); }
register_activation_hook( __FILE__,'onactivation_install' );
答案 0 :(得分:1)
传递此参数
$flag = wp_handle_upload($src,array( 'test_form' => false ));