Tribe__Repository::by_primary_key( mixed $primary_key )
Fetches a single instance of the post type handled by the repository.
Contents
Similarly to the get_post function permissions are not taken into account when returning an instance by its primary key; extending classes can refine this behaviour to suit.
Parameters
- $primary_key
-
(mixed) (Required)
Return
(WP_Post|null|mixed)
Source
File: src/Tribe/Repository.php
public function by_primary_key( $primary_key ) {
return $this->by( $this->primary_key, $primary_key )->first();
}