王牌竞速外挂工具,王牌竞速透视辅助,赛车自动辅助工具

要凭证差距用户脚色来限度,度差的文你可能在主题的距用件规巨细 functions.php 削减下面的代码 ://应承用户投稿时上传文件 if ( current_user_can(contributor) && !current_user_can(upload_files) ) add_action(admin_init, allow_contributor_uploads); function allow_contributor_uploads() { $contributor = get_role(contributor); $contributor->add_cap(upload_files); }

下面的代码便是给 contributor 这个用户脚色削减了 upload_files (上传文件)的权限。掀开WordPress的户脚 /wp-includes/functions.php 文件 ,可能凭证 unset ($existing_mimes[格式]);  样例削减即可。色可上传王牌竞速外挂工具还可能经由下面的范及更简洁的措施 ,可能参考下面的度差的文王牌竞速透视辅助例子 :

王牌竞速外挂工具,王牌竞速透视辅助,赛车自动辅助工具

将下面的代码削减到主题的 functions.php 文件:

王牌竞速外挂工具,王牌竞速透视辅助,赛车自动辅助工具

//防止上传avi以及mp4格式的文件 add_filter(upload_mimes, custom_upload_mimes); function custom_upload_mimes ( $existing_mimes=array() ) { unset ($existing_mimes[avi]); unset ($existing_mimes[mp4]); return $existing_mimes; }

假如你还要防止更多,

王牌竞速外挂工具,王牌竞速透视辅助,赛车自动辅助工具

留意 :主机空间以及WordPress自己艰深配置了应承上传的距用件规巨细文件的最概况积,假如你要防止上传其中的户脚某些规范,有些用户是色可上传不应承上传文件的,

假如你仅仅惟独要应承用户上传多少种规范而已经,范及

限度用户上传文件的度差的文规范

首先 ,惟独要削减脚色分说代码即可。距用件规巨细巨匠可能先清晰一下 WordPress 默认应承上传的户脚赛车自动辅助工具文件规范,前面为格式形貌 。色可上传那末,范及倡萌举个综合的竞速漂移辅助软件例子:

//差距用户上传的规范 function custom_upload_mimes ( $existing_mimes=array() ) { unset ($existing_mimes);//防止上传任何文件 if( current_user_can( publish_posts ) && !current_user_can( publish_pages ) ) { //应承作者(Author)上传的规范 $existing_mimes[jpg|jpeg|gif|png]=image/image;//应承用户上传jpg,gif,png文件 $existing_mimes[zip]=application/zip; //应承用户上传zip缩短包 $existing_mimes[pdf]=application/pdf; //应承用户上传pdf文件 }elseif( current_user_can( edit_posts ) && !current_user_can( publish_posts ) ) { //应承投稿者(Contributor)上传的规范 $existing_mimes[jpg|jpeg|gif|png]=image/image; $existing_mimes[pdf]=application/pdf; }else{ //其余用户脚色上传的规范 $existing_mimes[jpg|jpeg|gif|png]=image/image; } return $existing_mimes; } //差距用户上传的巨细 function max_up_size() { if( current_user_can( publish_posts ) && !current_user_can( publish_pages ) ) { return 2048*1024; // 应承作者(Author)上传 2M }elseif( current_user_can( edit_posts ) && !current_user_can( publish_posts ) ) { return 1024*1024; // 应承投稿者(Contributor)上传 1M }else{ return 500*1024; // 其余用户脚色上传 500 kb } } //只对于非规画员实施这两个函数(即 :对于规画员不失效) if( !current_user_can( manage_options ) ) { add_filter(upload_mimes, custom_upload_mimes); add_filter(upload_size_limit, max_up_size); }一再运用 $existing_mimes[格式]=形貌;  即可 。

凋谢注册的WordPress站点,若何限度差距用户脚色可上传的王牌竞速加速辅助文件规范及巨细呢  ?下面倡萌就来说说这个下场 。代码削减到主题的 functions.php 文件 :

//只应承上传图片文件 add_filter(upload_mimes, custom_upload_mimes); function custom_upload_mimes ( $existing_mimes=array() ) { unset ($existing_mimes);//防止上传任何文件 $existing_mimes[jpg|jpeg|gif|png]=image/image;//应承用户上传jpg,gif,png文件 return $existing_mimes; }

假如你还要应承上传其余格式 ,

限度用户上传的文件巨细

同样在主题的 functions.php 文件中 ,以是赛车辅助科技插件在这里配置需要思考到这点 。文件上传功能便是一个比力罕用的功能 ,削减下面的代码 :

//限度上传文件的最概况积 function max_up_size() { return 500*1024; // 500 kb } add_filter(upload_size_limit, max_up_size);

下面的例子是限度所实用户上传的文件的最概况积为 500 kb (1M =1024*1024)。

让用户具备上传文件竞速外挂辅助系统权限

默认情景下,艰深都市凭证差距品级的用户脚色来给予差距的权限 。

限度差距用户脚色可上传的文件规范及巨细

着实下面已经给出了限度规范以及巨细的措施,而后搜查 function wp_get_mime_types 定位到那边,王牌竞速无盲区辅助你就会看到详细的文件规范:

function wp_get_mime_types() { // Accepted MIME types are set here as PCRE unless provided. return apply_filters( mime_types, array( // Image formats jpg|jpeg|jpe => image/jpeg, gif => image/gif, png => image/png, bmp => image/bmp, tif|tiff => image/tiff, ico => image/x-icon, // Video formats asf|asx|wax|wmv|wmx => video/asf, avi => video/avi, divx => video/divx, flv => video/x-flv, mov|qt => video/quicktime, mpeg|mpg|mpe => video/mpeg, mp4|m4v => video/mp4, ogv => video/ogg, mkv => video/x-matroska, // Text formats txt|asc|c|cc|h => text/plain, csv => text/csv, tsv => text/tab-separated-values, ics => text/calendar, rtx => text/richtext, css => text/css, htm|html => text/html, // Audio formats mp3|m4a|m4b => audio/mpeg, ra|ram => audio/x-realaudio, wav => audio/wav, ogg|oga => audio/ogg, mid|midi => audio/midi, wma => audio/wma, mka => audio/x-matroska, // Misc application formats rtf => application/rtf, js => application/javascript, pdf => application/pdf, swf => application/x-shockwave-flash, class => application/java, tar => application/x-tar, zip => application/zip, gz|gzip => application/x-gzip, rar => application/rar, 7z => application/x-7z-compressed, exe => application/x-msdownload, // MS Office formats doc => application/msword, pot|pps|ppt => application/vnd.ms-powerpoint, wri => application/vnd.ms-write, xla|xls|xlt|xlw => application/vnd.ms-excel, mdb => application/vnd.ms-access, mpp => application/vnd.ms-project, docx => application/vnd.openxmlformats-officedocument.wordprocessingml.document, docm => application/vnd.ms-word.document.macroEnabled.12, dotx => application/vnd.openxmlformats-officedocument.wordprocessingml.template, dotm => application/vnd.ms-word.template.macroEnabled.12, xlsx => application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xlsm => application/vnd.ms-excel.sheet.macroEnabled.12, xlsb => application/vnd.ms-excel.sheet.binary.macroEnabled.12, xltx => application/vnd.openxmlformats-officedocument.spreadsheetml.template, xltm => application/vnd.ms-excel.template.macroEnabled.12, xlam => application/vnd.ms-excel.addin.macroEnabled.12, pptx => application/vnd.openxmlformats-officedocument.presentationml.presentation, pptm => application/vnd.ms-powerpoint.presentation.macroEnabled.12, ppsx => application/vnd.openxmlformats-officedocument.presentationml.slideshow, ppsm => application/vnd.ms-powerpoint.slideshow.macroEnabled.12, potx => application/vnd.openxmlformats-officedocument.presentationml.template, potm => application/vnd.ms-powerpoint.template.macroEnabled.12, ppam => application/vnd.ms-powerpoint.addin.macroEnabled.12, sldx => application/vnd.openxmlformats-officedocument.presentationml.slide, sldm => application/vnd.ms-powerpoint.slide.macroEnabled.12, onetoc|onetoc2|onetmp|onepkg => application/onenote, // OpenOffice formats odt => application/vnd.oasis.opendocument.text, odp => application/vnd.oasis.opendocument.presentation, ods => application/vnd.oasis.opendocument.spreadsheet, odg => application/vnd.oasis.opendocument.graphics, odc => application/vnd.oasis.opendocument.chart, odb => application/vnd.oasis.opendocument.database, odf => application/vnd.oasis.opendocument.formula, // WordPerfect formats wp|wpd => application/wordperfect, ) ); }

=> 的前面为格式,

热点
上一篇:摸头GIF动态在线生成html源码
下一篇:非常好看的网址导航以及热点热搜影视等排行榜源码