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
上面是“wordpress利用get_post_field可以获取哪些字段”的全面内容,想了解更多关于 wordpress 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_3570.html
workflows工作流
严寒的冬天里一只小鸟在森林的树枝上休息
金色玫瑰花comfyui工作流
图片转视频ComfyUI工作流
一张超现实主义美女照片ComfyUI工作流
文生图工作流:一幅海底睡莲,碧海蓝天comfyui工
一对葫芦ComfyUI工作流
梦幻中的一只猫咪ComfyUI工作流
一只开屏的白色孔雀ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!