• Resolved Michelle R. Wood

    (@woodmr)


    I have a date/time field (‘show_date’) that is set to a certain date format (‘l m/d/Y’) in its settings. It’s assigned to a custom content type (‘show’).

    On the shows archive, I have each post displaying with the Post Title and the show_date field, which I would like to only show with the date form ‘M Y’. I’ve added the custom date function described in PODs documentation and attempted to use the filter, but so far it just returns the same exact format as settings. Is there a setting with the field I have to switch on to use the filter? I have the function inserted via the code snippet plugin: is that potentially the problem? Do I need to add the function via a filter/action after inserting the function?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Testing found the code on the documentation page is fine, and it is also fine to use a snippets plugin.

    The reason for the formatting callback not running is likely the new security setting added to Pods Admin > Settings. In default setup, there is a field near the end of the page called Display callbacks allowed

    If the formatting function is called my_custom_date_format, an appropriate value for this field might be esc_attr,esc_html,my_custom_date_format — which would allow the date format callback and the two default attribute and HTML escaping functions to be used as Magic Tag helpers.

    Thread Starter Michelle R. Wood

    (@woodmr)

    Thanks for your help, that did the trick! It would be really helpful if that information was added to the documentation on the PODs website (https://docs.pods.io/displaying-pods/magic-tags/display-filters-with-magic-tags/#Examples).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Date Format Custom Filter’ is closed to new replies.