API / Minn\Auth / TypeCapabilities

TypeCapabilities final readonly class

Minn\Auth\TypeCapabilities · public/minn/src/Minn/Auth/TypeCapabilities.php · 51 lines

The capability names a post type's permissions are built from. Posts and pages own their families (edit_posts, edit_others_pages, ...). Navigation menus fold every one of them onto edit_theme_options, which is why an editor may read a menu and only an administrator may change one; the reference's own registration says the same thing. A plugin's type answers with the names it registered.

Constants and properties

privateFOLDED = array ( 'wp_navigation' => 'edit_theme_options', )

Types whose whole cap family collapses to a single name.

Public

staticof(string $type, string $capability): string#

A cap name built from the post/page family, folded when the type folds, or the plugin type's own name for it (probe rest-plugin-caps).

staticcreate(string $type): string#

The capability creating a post of the type needs: the edit capability, or a plugin type's create_posts.

staticplural(string $type): string#

The capability stem of a type: pages for page, posts for everything else.

staticedit(string $type): string#

The edit capability of a type.

staticeditOthers(string $type): string#

The edit-others capability of a type.

staticpublish(string $type): string#

The publish capability of a type.

staticreadPrivate(string $type): string#

The read-private capability of a type.