There is an unreleased patch for this, but in the meantime, see https://docs.pods.io/code-snippets/date-format-output-filter-for-magic-tags/ for how to filter the output. For example:
Create a function in theme functions.php, a new plugin, or a Code Snippets plugin:
function date_to_jfy( $input_date ) {
return date( 'j F Y', strtotime( $input_date ) );
}
Add the name of the function, date_to_jfy in the example above, to the list of allowed display functions near the bottom of Pods Admin > Settings in the security section.
Use the formatting function on the magic tag with a comma and the function name: {@post_date,date_to_jfy}
Generically:
- Any magic tag can be filtered through any function added to the allow list.
- The function must take one argument. The value will be the value of the magic tag.
- The function must return text (a string), which will be displayed.
- The syntax is
{@name_of_field,name_of_function} — the field name followed by a comma and the function name.
Display functions are usually custom, but any pre-defined function which receives one argument containing text and returns text can also be used if added to the whitelist.
Thread Starter
Sun
(@sunrv)
Hi Paul,
Thanks for the reply, it worked almost perfectly! The only issue I have now is that it shows the month string in English, while the website language is Dutch. I set this up in the WordPress settings and the HTML language is also nl-NL.
Is it possible to translate the month string accordingly?
date_i18n() with the same format as date()