• I am trying to display the “create date” in a download button template, and it is showing correctly as “February 2, 2016” on any english page that I use the template on, but it is incorrectly showing as todays date for any non-english page (so today it’s showing “16 marzo 2016” on any italian page where I use the shortcode for the template).

    I’m specifically editing the wpdm-button-templates.php file and I am checking the information like this:

    function template($params){
            $style = isset($params['style'])?$params['style']:'light';
            $id = isset($params['id'])?$params['id']:false;
            extract($params);
            if(!isset($align)) $align = "center";
            if(!$id) return "";
            $package = get_post($id, ARRAY_A);
            $package = wpdm_setup_package_data($package);
            $link_label = $package['link_label'];
            $file_size = get_post_meta($id, '__wpdm_package_size', true);
            $icon = get_post_meta($id, '__wpdm_icon', true);
            $icon = get_post_meta($id, '__wpdm_icon', true);
            $keys = [];
            $keystring = "";
            echo "<div style=\"display:none;\">";
            foreach($package as $key => $value){
              echo  "<b>" . $key . "</b> : <i>" . $value . "</i><br>";
            }
            echo "</div>";
            $html = <<<HTML
            <div class="w3eden">
    <div class="link-btn {$style}  p{$align}" style="border-radius:3px 3px 0px 0px;">
        <div class="media">
            <div class="pull-left wbt-left"><div class="wbt-icon">{$package['icon']}</div></div>
            <div class="media-body text-left wbt-content"><strong class="ptitle">
                    {$package['title']}
                </strong>
    
                <div style="font-size: 8pt;padding-top: 1px">{$link_label} <i style="margin: 4px 0 0 5px;opacity:0.5"
                                                               class="fa fa-th-large"></i> {$package['file_size']}
                </div>
            </div>
        </div>
    </div>
    <div style="clear: both;"></div>
    <div class="link-btn p{$align}" style="border-top:0px;border-radius:0px 0px 3px 3px;border-color:#222222;background-color:#777777;">
        <div class="media">
            <div class="media-body text-left wbt-content">
                <div style="font-size: 10pt;font-weight:bold;color:#CCCCCC;padding-top: 1px;text-shadow: 1px 1px 2px Black;">Created:&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:White;">{$package['create_date']}</span></div>
                <div style="font-size: 10pt;font-weight:bold;color:#CCCCCC;padding-top: 1px;text-shadow: 1px 1px 2px Black;">Version:&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:White;">{$package['version']}&nbsp;&nbsp;&nbsp;&nbsp;({$package['update_date']})</span></div>
                <div style="font-size: 10pt;font-weight:bold;color:#CCCCCC;padding-top: 1px;text-shadow: 1px 1px 2px Black;">Total Downloads:&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:White;">{$package['download_count']}</span></div>
            </div>
        </div>
    </div>
    <div style="clear: both;"></div>
    </div>
    <script>
    jQuery(function(){
    jQuery('.link-btn a.wpdm-download-link img').after('{$link_label}');
    jQuery('.link-btn a.wpdm-download-link img').remove();
    });
    </script>
    HTML;
            $html = str_replace(array("\r","\n"), "", $html);
    
            if(!wpdm_is_locked($id) && wpdm_user_has_access($id)){
                return "<a href='".wpdm_download_url($package)."'>{$html}</a>";
            } else
                return FetchTemplate("[download_link]", $package);
    
        }

    Then in the chrome inspector I just uncheck the “display:none” rule for the div I created so that I can see all the available information for the package. The $package['create_date'] is displaying correctly only on english pages. I use the polylang plugin. How is the “create_date” value getting populated?

    https://wordpress.org/plugins/download-manager/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘wrong "create date" on non-english pages’ is closed to new replies.