wc_update_310_old_comments()

Find old order notes and ensure they have the correct type for exclusion.


Description Description


Source Source

File: includes/wc-update-functions.php

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 = '';" );
}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.