Skip to content

Commit a55b03f

Browse files
committed
"is_private()" implemented in "Order" model class.
1 parent 1a2410f commit a55b03f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

includes/model/class-order.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,18 @@ protected function init() {
267267

268268
parent::prepare_fields();
269269
}
270+
271+
/**
272+
* Determines if the data object should be considered private
273+
*
274+
* @access public
275+
* @return bool
276+
*/
277+
protected function is_private() {
278+
if ( current_user_can( $this->post_type_object->cap->edit_others_posts ) ) {
279+
return true;
280+
}
281+
282+
return $this->owner_matches_current_user();
283+
}
270284
}

0 commit comments

Comments
 (0)