Ignore some metadata in the HPOS verify tool (#40338)

This commit is contained in:
Ron Rennick 2023-09-21 13:35:37 -03:00 committed by GitHub
commit 087813f52d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Exclude some metadata from being considered in HPOS verify tool.

View File

@ -581,11 +581,19 @@ class CLIRunner {
* @return array Failed IDs with meta details.
*/
private function verify_meta_data( array $order_ids, array $failed_ids ) : array {
$meta_keys_to_ignore = array(
'_paid_date', // This is set by the CPT datastore but no longer used anywhere.
'_edit_lock',
);
global $wpdb;
if ( ! count( $order_ids ) ) {
return array();
}
$excluded_columns = $this->post_to_cot_migrator->get_migrated_meta_keys();
$excluded_columns = array_merge(
$this->post_to_cot_migrator->get_migrated_meta_keys(),
$meta_keys_to_ignore
);
$excluded_columns_placeholder = implode( ', ', array_fill( 0, count( $excluded_columns ), '%s' ) );
$order_ids_placeholder = implode( ', ', array_fill( 0, count( $order_ids ), '%d' ) );
$meta_table = OrdersTableDataStore::get_meta_table_name();