Open russell-edsvcs opened 2 months ago
The code for that is currently:
/**
* Get a field display value from a Pod.
*
* @param string|null $pod The pod name, or if you are in The Loop then you can just provide the field name to auto-detect pod/id using loop information.
* @param mixed|null $id The ID or slug of the item.
* @param string|array $name The field name, or an associative array of parameters.
* @param boolean $single For tableless fields, to return the whole array or the just the first item.
*
* @return mixed Field value.
*
* @since 2.1.0
*/
function pods_field_display( $pod, $id = null, $name = null, $single = false ) {
Are you just saying that the name of the argument should match the older $type
argument name used in pods()
?
Question for you -- what's the use case for calling pods_field_display()
with a Pods object? Why wouldn't you call $pod->display( ... )
instead?
The code for that is currently:
/** * Get a field display value from a Pod. * * @param string|null $pod The pod name, or if you are in The Loop then you can just provide the field name to auto-detect pod/id using loop information. * @param mixed|null $id The ID or slug of the item. * @param string|array $name The field name, or an associative array of parameters. * @param boolean $single For tableless fields, to return the whole array or the just the first item. * * @return mixed Field value. * * @since 2.1.0 */ function pods_field_display( $pod, $id = null, $name = null, $single = false ) {
Are you just saying that the name of the argument should match the older
$type
argument name used inpods()
?
Yes, that is what I was trying to say. It doesn't make sense to call the same thing two different names, and it confused me when I encountered it, so I thought I would report it. Side note, I have no idea why the heck I used the word therefore
like that in my original post 🤪. I think that was left over from something else I was going to say. Ignore that.
Description
The first parameter of
pods_field_display
is a$pod
, but if you actually give it a pod object it doesn't work. Looking into this function, it passes this parameter to https://docs.pods.io/code/pods/ as the$type
parameter. Therefore, the first parameter ofpods_field_display
should probably matchpods()
and be named$type
.Version
all
Testing Instructions
No response
Screenshots / Screencast
No response
Possible Workaround
No response
Site Health Information
No response
Pods Package
No response