pass protect orders - can help hide comments from custom comment queries

This commit is contained in:
Mike Jolley 2011-12-05 10:56:54 +00:00
parent 6e4c5a1cf0
commit cc40c87349
1 changed files with 9 additions and 1 deletions

View File

@ -512,7 +512,15 @@ function woocommerce_process_shop_order_meta( $post_id, $post ) {
endif;
update_post_meta( $post_id, '_order_items', $order_items );
// Give a password - not used, but can protect the content/comments from theme functions
if ($post->post_password=='') :
$order_post = array();
$order_post['ID'] = $post_id;
$order_post['post_password'] = uniqid('order_');
wp_update_post( $order_post );
endif;
// Order data saved, now get it so we can manipulate status
$order = &new woocommerce_order( $post_id );