wp_ext2type 函数,根据文件后缀判断文件类型。
函数原型:
function wp_ext2type( $ext )
函数源码:
function wp_ext2type( $ext ) {
$ext = strtolower( $ext );
$ext2type = wp_get_ext_types();
foreach ( $ext2type as $type => $exts ) {
if ( in_array( $ext, $exts, true ) ) {
return $type;
}
}
}
可以看到这个函数,用到了 wp_get_ext_types 。
其原理就是,按表查询。实现原理简单,使用却很方便。
-
WordPress函数:wp_trash_post_comments 移动文章评论到垃圾站WordPress函数:wp_trash_post_comments 移动文章评论到垃圾站
-
WordPress函数:wp_delete_attachment 删除附件WordPress函数:wp_delete_attachment 删除评论
-
WordPress函数:wp_update_user 更新用户信息WordPress函数:wp_update_user 更新用户信息
-
WordPress函数:add_shortcode 添加短代码WordPress函数:add_shortcode 添加短代码
-
WordPress函数:remove_shortcode 删除短代码WordPress函数:remove_shortcode 删除短代码
-
2款CMS小程序之追格资讯小程序(WordPress小程序)CMS一般指内容管理系统,内容管理系统(Content Management System,CMS),比如WordPress也是CMS系统,当然还有更多。
暂无评论,抢个沙发...