• Resolved ayalena

    (@ayalena)


    Hi,

    I have a problem with this plugin in Woocomerce products – after editing the date and updating the product the modified date changes to current date (even if I tick the “disable” checkbox). I tried it also with simple posts – it works there.

    Any help would be appreciated, it seems to be a great plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ayalena

    (@ayalena)

    Hi, I finally managed to edit the edit-screen.php file – now it works ??

    Plugin Author Sayan Datta

    (@infosatech)

    Hello,

    Could you please tell me what you are actually edited as everything is working fine from my end.

    Thanks!

    Thread Starter ayalena

    (@ayalena)

    Hi,

    I tried again to disable all the plugins that could cause some conflict, but the problem persists – but maybe I overlooked something. So I added this action to my child’s theme to make sure the date is written down to db and everything works fine now:

    add_action(‘save_post’, ‘change_date’);

    function change_date($post_id) {

    global $wpdb;

    $mm = $_POST[‘mmm’];
    $jj = $_POST[‘jjm’];
    $aa = $_POST[‘aam’];
    $hh = $_POST[‘hhm’];
    $mn = $_POST[‘mnm’];
    $ss = $_POST[‘ssm’];

    $newdate = sprintf(“%04d-%02d-%02d %02d:%02d:%02d”, $aa, $mm, $jj, $hh, $mn, $ss);

    if ( !empty( $mm ) ) {
    $post_modified= $newdate;
    $post_modified_gmt = get_gmt_from_date( $newdate );
    $wpdb->query(“UPDATE $wpdb->posts SET post_modified = ‘{$post_modified}’, post_modified_gmt = ‘{$post_modified_gmt}’ WHERE ID = {$post_id}” ); }

    Plugin Author Sayan Datta

    (@infosatech)

    Hello @ayalena

    This bug has been fixed on the latest version.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot change the modified date in product’ is closed to new replies.