PostLookup final readonly class
Minn\Runtime\PostLookup · public/minn/src/Minn/Runtime/PostLookup.php · 134 lines
The post reads plugin code asks for by shape: a page by title, revisions, counts.
Constants and properties
| private | readonly Minn\Db $db | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db)# | ||||||||||
| method | idByTitle(string $title, array $types): ?int# | The id of a post with this title among the types, or null.
| |||||||||
| method | revisionsOf(int $postId): array# | Revision rows newest first. @return list<array<string, mixed>> @return list<array<string, mixed>> | |||||||||
| method | countByStatus(string $type): array# | How many posts of a type there are per status. @return array<string, int> status => count | |||||||||
| method | countAttachments(): array# | How many attachments there are per mime type. @return array<string, int> mime type => count, plus 'trash' | |||||||||
| method | countByAuthor(int $userId, array $types, array $statuses): int# | How many posts an author has among the types and statuses.
| |||||||||
| method | countsByAuthors(array $userIds, array $types, array $statuses): array# | Post counts for several authors at once, as stored (strings), for those that have any.
@return array<int, string> | |||||||||
| method | publishingAuthors(string $type, int $limit): int# | How many authors (up to a limit) have published posts of a type, for is_multi_author. | |||||||||
| method | countsByAuthor(array $types, array $statuses, int $viewer): array# | Post counts by author for wp_list_authors: the types' posts in the statuses given, and the private ones of the viewer (an id, or -1 for none) beside them.
@return array<int, int> | |||||||||
| method | idsByAuthor(int $userId): array# | Every post id of an author. @return list<int> | |||||||||
| method | attachmentIdByFile(string $path): ?int# | The attachment whose stored file path is the given one. |
Nothing matches.