
wordpress利用get_post_field可以获取哪些文章字段,下面web建站小编给大家详细介绍一下具体实现代码!
函数源码介绍:
function get_post_field( $field, $post = null, $context = 'display' ) {
$post = get_post( $post );
if ( ! $post ) {
return '';
}
if ( ! isset( $post->$field ) ) {
return '';
}
return sanitize_post_field( $field, $post->$field, $post->ID, $context );
}
$post相关函数介绍:
ID post_author post_date post_date_gmt post_content post_title post_excerpt post_status comment_status ping_status post_password post_name to_ping pinged post_modified post_modified_gmt post_content_filtered post_parent guid menu_order post_type post_mime_type comment_count filter ...
get_post_field调用方法:
get_post_field('ID'); // 返回当前文章的ID
WordPress版本如何使用str_starts_with和str_ends_with函数
wordpress教程如何输出用于回复评论的隐藏输入html
标签: get_post_field, wordpress函数
上面是“wordpress利用get_post_field可以获取哪些字段”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_3570.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

一款免费的动态抽象背景生成器,一键创建酷炫背景——Color4bg
dede织梦后台模块管理空白不显示的解决方法
CCleaner:可以清除浏览器缓存、cookies、历史记录,以及各种临时文件和日志
2345看图王
7点电影官方网址入口,汇集了网上最全、最新的电影