Automattic\WooCommerce\Internal\DataStores\Orders
HposOrderCapabilityHelper::get_author_id
Get the author ID to use for WordPress-style capability checks.
Method of the class: HposOrderCapabilityHelper{}
No Hooks.
Returns
Int. Author ID.
Usage
// private - for code of main (parent) class only $result = $this->get_author_id( ?WP_Post $post ): int;
- ?WP_Post $post(required)
- .
HposOrderCapabilityHelper::get_author_id() HposOrderCapabilityHelper::get author id code WC 11.0.0
private function get_author_id( ?WP_Post $post ): int {
if ( $post instanceof WP_Post && 0 < (int) $post->post_author ) {
return (int) $post->post_author;
}
return 1;
}