• Resolved samtempa

    (@samtempa)


    Hi there,

    I’m involved with the maintenance of a clients website that uses Pods for displaying their blog posts and they’ve recently noticed that the format of the date has changes so that is now showing everything down to the second that the post was created. I’ve noticed that it seems to be an issue that has been flagged a few times but with it been the first time I’ve come across the plugin I thought I best get clarification on the solution.

    Is it not possible to add the PHP function callbacks through the Pods Admin anymore? A few of the solutions I found mentioned this was how to fix it (by adding format_date) to this list but I can’t see an input field amongst the Display Callback settings in the admin area.

    I have access to the codebase but currently the only mention of ‘pods_display_callbacks_allowed’ is in the access.php file within the plugin folder, is this okay to modify?

    Current line

    $display_callbacks_allowed = pods_get_setting( 'display_callbacks_allowed', 'esc_attr,esc_html' );

    The website in question is quite large and has a lot of plugins installed so I thought it be best I run this past your support team before attempting a fix myself.

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support pd

    (@pdclark)

    Thread Starter samtempa

    (@samtempa)

    Edited – Images didn’t upload so I’ve typed them out

    Thanks for getting back to me @pdclark

    Are you okay just confirming a few things for me though as I’m still struggling to get the date to display properly and I’m just wanting to rule out where the error’s coming from as I’m aware that it could be due a plugin conflict.

    After following the steps listed in the two posts that you linked me my functions.php file contains the following line

    // Custom Functions for date format on blog posts (Pod callback)

    function format_pods_date( $input_date ) {
    return date_i18n( 'j F Y', strtotime( $input_date ) );
    }

    And my wp-config.php file contains the following

    define( 'PODS_DISPLAY_CALLBACKS', 'customized' );
    define( 'PODS_DISPLAY_CALLBACKS_ALLOWED', 'format_pods_date, format_date' );

    The reason I also included format_date was because I noticed the following message in the admin area

    Disallowed display callbacks were detected on this site. These callbacks were blocked and were not run.

    Disallowed callbacks: format_date

    Review your Display callbacks setting if you expected these functions to be allowed, or dismiss this notice after you have reviewed the list.

    I also tried updating the field directly in the Pods Admin settings but to no prevail.

    Display callbacks allowed: format_pods_date, format_date

    Do I need to add custom_pods_callback_ in front of my function declarations and/or where I am allowing them? I couldn’t see mention of that in the two other forum posts that you linked me but I noticed the following tootip underneath the field where you enter the callbacks you want to allow.

    "Please provide a comma-separated list of additional PHP function names to allow in callbacks, on top of the built-in safe list. Each additional function name must start with "custom_pods_callback_" and any other names are ignored for security purposes. You may choose to add custom PHP filter for "pods_access_callbacks_custom_prefix" to change this prefix"

    Thanks in advance!

    Sam

    • This reply was modified 2 days, 19 hours ago by samtempa.
    Plugin Support pd

    (@pdclark)

    Yes, see the add_filter mentioned to remove the prefix requirement: https://wordpress.org/support/topic/pods_display_callbacks_allowed-not-working/#post-19014767

    …possibly may be automated in a later version when wp-config defines are used

    Thread Starter samtempa

    (@samtempa)

    @pdclark That appears to have worked, didn’t notice it when I first read the post.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.