Update function to ensure notes have correct type (pre WC 1.6)
This commit is contained in:
parent
75480ab99f
commit
caacd65085
|
@ -81,6 +81,7 @@ class WC_Install {
|
|||
),
|
||||
'3.1.0' => array(
|
||||
'wc_update_310_downloadable_products',
|
||||
'wc_update_310_old_comments',
|
||||
'wc_update_310_db_version',
|
||||
),
|
||||
);
|
||||
|
|
|
@ -1112,6 +1112,15 @@ function wc_update_310_downloadable_products() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find old order notes and ensure they have the correct type for exclusion.
|
||||
*/
|
||||
function wc_update_310_old_comments() {
|
||||
global $wpdb;
|
||||
|
||||
$wpdb->query( "UPDATE $wpdb->comments comments LEFT JOIN $wpdb->posts as posts ON comments.comment_post_ID = posts.ID SET comment_type = 'order_note' WHERE posts.post_type = 'shop_order' AND comment_type = '';" );
|
||||
}
|
||||
|
||||
/**
|
||||
* Update DB Version.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue