Form_Capabilities::set_capabilities()

Sets the supported capabilities.

Description

Source

File: src/db-objects/forms/form-capabilities.php

	protected function set_capabilities() {
		parent::set_capabilities();

		$prefix = $this->get_prefix();

		$singular_slug = $this->manager->get_singular_slug();
		$plural_slug   = $this->manager->get_plural_slug();

		$this->base_capabilities['publish_items'] = sprintf( 'publish_%s', $prefix . $plural_slug );
		$this->meta_capabilities['publish_item'] = sprintf( 'publish_%s', $prefix . $singular_slug );

		$this->base_capabilities['read_private_items']     = sprintf( 'read_private_%s', $prefix . $plural_slug );
		$this->base_capabilities['edit_published_items']   = sprintf( 'edit_published_%s', $prefix . $plural_slug );
		$this->base_capabilities['edit_private_items']     = sprintf( 'edit_private_%s', $prefix . $plural_slug );
		$this->base_capabilities['delete_published_items'] = sprintf( 'delete_published_%s', $prefix . $plural_slug );
		$this->base_capabilities['delete_private_items']   = sprintf( 'delete_private_%s', $prefix . $plural_slug );

		$this->base_capabilities['manage_item_settings'] = sprintf( 'manage_%s_settings', $prefix . $singular_slug );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.