function pods_field_display ( $pod, $id = false, $name = null, $single = false )
参数 数据类型 备注
$pod (string) Pod name,即为 pods 机读名称
$id (mixed) (选填) 某篇文章ID或slug,以查询该篇文章数据
$name (string|array) 字段名称,或者关联数组的参数
$single (boolean) (选填) 是否以数组的形式返回
pods_field_display() 不会真正的显示出一张图片,而是显示出图片的 URL,pods 特地为图片显示定义了一个函数:
pods_image ( $image, $size = 'thumbnail', $default = 0, $attributes = '', $force = false )
关于该函数的文档,请查看 官方文档。
function pods_image ( $image, $size = 'thumbnail', $default = 0, $attributes = '', $force = false )
参数 数据类型 备注
$image (array|int|string) 图片字段的数组,或ID,或guid
$size (string|array) 图片大小样式
$default (int) 如果图片不存在,则显示该图片$default
$attributes (string|array) 图片属性 (内部通过 wp_get_attachment_image获取)
$force (boolean) 强制规定大小
Phone
Password
Pptext
Date time
Pnumber
Currency
Color
欢迎光临 5ucms论坛 (http://bbs.5ucms.com/) | Powered by Discuz! X3.2 |