黄聪

论SEO对人类的重要性,请看我的博客:hcsem.com

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

1、直接禁用文件类型检测,在wp-config.php文件中,添加这样一句代码define('ALLOW_UNFILTERED_UPLOADS', true);

2、在functions.php里面,添加下面代码(最重要是黄色背景那2句):

<?
    // 添加一个角色,允许地区编辑添加
    add_role('dq_edit','地区编辑', array(
        'level_3'      => true,
        'read'         => true,
        'edit_posts'   => true,
        'edit_published_posts' => true,
        'edit_others_posts'    => true,
        'publish_posts'   => true,
        'upload_files'   => true,  //允许上传文件
        'unfiltered_upload'   => true, //允许上传不安全的文件
    ));
    
    $role_object = get_role( 'dq_edit' );
    //为角色对象添加权限$cap
    $role_object->add_cap( 'edit_jihua' );
    $role_object->add_cap( 'upload_files' );
?>

 

posted on 2015-07-27 16:48  黄聪  阅读(1898)  评论(0编辑  收藏  举报