Plugin Directory

Changeset 3100899


Ignore:
Timestamp:
06/11/2024 06:00:15 AM (10 months ago)
Author:
infinitnet
Message:

v1.8 release

Location:
content-update-scheduler/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • content-update-scheduler/trunk/content-update-scheduler.php

    r3100758 r3100899  
    88 * Author: Infinitnet
    99 * Author URI: https://infinitnet.io/
    10  * Version: 1.7
     10 * Version: 1.8
    1111 * License: GPLv3
    1212 * Text Domain: content-update-scheduler
     
    4040            }
    4141
    42         }
     42            add_filter('manage_edit-' . $post_type . '_columns', array( 'ContentUpdateScheduler', 'manage_pages_columns' ));
     43            add_action('manage_' . $post_type . '_posts_custom_column', array( 'ContentUpdateScheduler', 'manage_pages_custom_column' ), 10, 2);
     44        }
     45
     46        // Ensure the column is added for WooCommerce products
     47        add_filter('manage_edit-product_columns', array( 'ContentUpdateScheduler', 'manage_pages_columns' ));
     48        add_action('manage_product_posts_custom_column', array( 'ContentUpdateScheduler', 'manage_pages_custom_column' ), 10, 2);
    4349
    4450        // Oxygen plugin active.
     
    705711            delete_post_meta($destination_post->ID, $key); // Delete existing meta to avoid duplicates
    706712            foreach ($values as $value) {
    707                 if (is_serialized($value)) {
    708                     $value = preg_replace_callback('/O:\d+:"([^"]+)"/', function ($matches) {
    709                         return class_exists($matches[1]) ? $matches[0] : 'O:8:"stdClass"';
    710                     }, $value);
     713                foreach ($values as $value) {
     714                    if (is_serialized($value)) {
     715                        $value = preg_replace_callback('/O:\d+:"([^"]+)"/', function ($matches) {
     716                            return class_exists($matches[1]) ? $matches[0] : 'O:8:"stdClass"';
     717                        }, $value);
     718                       
     719                        $unserialized_value = maybe_unserialize($value);
     720                       
     721                        if (is_string($unserialized_value) && strpos($unserialized_value, 'O:8:"stdClass"') !== false) {
     722                            // Skip this meta entry if it contains undefined objects
     723                            error_log('Skipping meta entry for key: ' . $key . '. Unserialized value contains undefined objects.');
     724                            continue 2;
     725                        }
     726                    } else {
     727                        $unserialized_value = $value;
     728                    }
    711729                   
    712                     $unserialized_value = maybe_unserialize($value);
     730                    if ($restore_references && is_string($unserialized_value) && strpos($unserialized_value, (string)$source_post->ID) !== false) {
     731                        $unserialized_value = str_replace((string)$source_post->ID, (string)$destination_post->ID, $unserialized_value);
     732                    }
    713733                   
    714                     if (is_string($unserialized_value) && strpos($unserialized_value, 'O:8:"stdClass"') !== false) {
    715                         // Skip this meta entry if it contains undefined objects
    716                         error_log('Skipping meta entry for key: ' . $key . '. Unserialized value contains undefined objects.');
    717                         continue 2;
    718                     }
    719                 } else {
    720                     $unserialized_value = $value;
     734                    add_post_meta($destination_post->ID, $key, maybe_serialize($unserialized_value));
    721735                }
    722                
    723                 if ($restore_references && is_string($unserialized_value) && strpos($unserialized_value, (string)$source_post->ID) !== false) {
    724                     $unserialized_value = str_replace((string)$source_post->ID, (string)$destination_post->ID, $unserialized_value);
    725                 }
    726                
    727                 add_post_meta($destination_post->ID, $key, $unserialized_value);
    728736            }
    729737        }
  • content-update-scheduler/trunk/readme.txt

    r3100687 r3100899  
    44Requires at least: 3.7.0
    55Tested up to: 6.5.4
    6 Stable tag: 1.7
     6Stable tag: 1.8
    77Requires PHP: 5.3
    88License: GPLv3
     
    5151== Changelog ==
    5252
     53=== 1.8 ===
     54* Various bug fixes
     55
    5356=== 1.7 ===
    5457* Fixed fatal error when class definition of metadata is missing and skip copying over metadata entries that fail to unserialize
Note: See TracChangeset for help on using the changeset viewer.