pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

[pods field="abc" raw="true"] #7126

Open Erudition opened 1 year ago

Erudition commented 1 year ago

Problem to Solve

I sometimes use the pods shortcode programmatically, such as for hiding parts of the page based on a Yes/No field. Boolean fields are currently not natively supported by my page builder (Elementor Pro), so I fall back to using a shortcode and checking equality. However, the label for a shortcode may change at any time, so I do not want to match on the Display value - just the raw value (1 or 0).

Proposed Solution

Add a "raw" option to the [pods field] syntax, that outputs the raw value instead of the display value, just like the Pods raw() php function.

Possible Workaround

One could create a custom shortcode via php and use raw().