dongque1646 2015-11-03 06:17
浏览 41
已采纳

如何在插件激活时在wordpress中移动文件

I want to move file in wordpress on plugin activation . i have written a code for this but it is not working .

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' );
  • 写回答

1条回答 默认 最新

  • duanjuduo4573 2015-11-03 06:43
    关注

    pass this parameter

    $flag = wp_handle_upload($src,array( 'test_form' => false ));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?