LLMS_Form_Post_Type::register_post_type()

Register the forms post type.


Return Return

(void)


Top ↑

Source Source

File: includes/forms/class-llms-form-post-type.php

	public function register_post_type() {

		$args = array(
			'label'               => __( 'LifterLMS Forms', 'lifterlms' ),
			'labels'              => array(
				'name'               => __( 'Forms', 'lifterlms' ),
				'singular_name'      => __( 'Form', 'lifterlms' ),
				'menu_name'          => _x( 'Forms', 'Admin menu name', 'lifterlms' ),
				'add_new'            => __( 'Add New Form', 'lifterlms' ),
				'add_new_item'       => __( 'Add New Form', 'lifterlms' ),
				'edit'               => __( 'Edit', 'lifterlms' ),
				'edit_item'          => __( 'Edit Form', 'lifterlms' ),
				'view'               => __( 'View Form', 'lifterlms' ),
				'view_item'          => __( 'View Form', 'lifterlms' ),
				'search_items'       => __( 'Search Forms', 'lifterlms' ),
				'not_found'          => __( 'No Forms found', 'lifterlms' ),
				'not_found_in_trash' => __( 'No Forms found in trash', 'lifterlms' ),
			),
			'public'              => false,
			'exclude_from_search' => true,
			'publicly_queryable'  => false,
			'show_ui'             => true,
			'show_in_nav_menus'   => false,
			'show_in_menu'        => 'lifterlms',
			'show_in_admin_bar'   => false,
			'supports'            => array( 'title', 'editor', 'custom-fields' ),
			'show_in_rest'        => true,
			'rewrite'             => false,
			'capabilities'        => array(
				'edit_post'              => $this->capability,
				'read_post'              => $this->capability,
				'delete_post'            => $this->capability,
				'edit_posts'             => $this->capability,
				'edit_others_posts'      => $this->capability,
				'publish_posts'          => $this->capability,
				'read_private_posts'     => $this->capability,
				'read'                   => 'read',
				'delete_posts'           => $this->capability,
				'delete_private_posts'   => $this->capability,
				'delete_published_posts' => $this->capability,
				'delete_others_posts'    => $this->capability,
				'edit_private_posts'     => $this->capability,
				'edit_published_posts'   => $this->capability,
				'create_posts'           => false,
			),
		);

		LLMS_Post_Types::register_post_type( $this->post_type, $args );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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