LLMS_Post_Types::get_post_type_caps( [type] $post_type )

Get an array of capabilities for a custom post type


Description Description


Parameters Parameters

$post_type

([type]) (Required) [description]


Top ↑

Return Return

([type]) [description]


Top ↑

Source Source

File: includes/class.llms.post-types.php

	public static function get_post_type_caps( $post_type ) {

		if ( ! is_array( $post_type ) ) {
			$singular = $post_type;
			$plural = $post_type . 's';
		} else {
			$singular = $post_type[0];
			$plural = $post_type[1];
		}

		return apply_filters( 'llms_get_' . $singular . '_post_type_caps', array(

			'read_post' => sprintf( 'read_%s', $singular ),
			'read_private_posts' => sprintf( 'read_private_%s', $plural ),

			'edit_post' => sprintf( 'edit_%s', $singular ),
			'edit_posts' => sprintf( 'edit_%s', $plural ),
			'edit_others_posts' => sprintf( 'edit_others_%s', $plural ),
			'edit_private_posts' => sprintf( 'edit_private_%s', $plural ),
			'edit_published_posts' => sprintf( 'edit_published_%s', $plural ),

			'publish_posts' => sprintf( 'publish_%s', $plural ),

			'delete_post' => sprintf( 'delete_%s', $singular ),
			'delete_posts' => sprintf( 'delete_%s', $plural ), // this is the core bug issue here
			'delete_private_posts' => sprintf( 'delete_private_%s', $plural ),
			'delete_published_posts' => sprintf( 'delete_published_%s', $plural ),
			'delete_others_posts' => sprintf( 'delete_others_%s', $plural ),

			'create_posts' => sprintf( 'create_%s', $plural ),

		) );

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.13.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink: