public/wordpress/wp-content/plugins/wp-courseware/includes/controllers/units.php
/**
	 * Register Course Units Post Type.
	 *
	 * @since 4.3.0
	 */
Register Course Units Post Type.
Register Course Units Post Type .
public function post_type() {
		$permalinks = $this->get_permalinks();
		register_post_type( $this->post_type_slug, apply_filters( 'wpcw_units_post_type_args', array(
			'labels'                => array(
				'name'               => __( 'Units', 'wp-courseware' ),
				'singular_name'      => __( 'Unit', 'wp-courseware' ),
				'all_items'          => __( 'All Units', 'wp-courseware' ),
				'new_item'           => __( 'New Unit', 'wp-courseware' ),
				'add_new'            => __( 'Add New', 'wp-courseware' ),
				'add_new_item'       => __( 'Add New Unit', 'wp-courseware' ),
				'edit_item'          => __( 'Edit Unit', 'wp-courseware' ),
				'view_item'          => __( 'View Unit', 'wp-courseware' ),
				'search_items'       => __( 'Search Units', 'wp-courseware' ),
				'not_found'          => sprintf( __( 'No units found. <a href="%s">Add a new unit</a>.', 'learnpress' ), admin_url( 'post-new.php?post_type=course_unit' ) ),
				'not_found_in_trash' => __( 'No units found in trash', 'wp-courseware' ),
				'parent_item_colon'  => __( 'Parent Unit:', 'wp-courseware' ),
				'menu_name'          => __( 'Units', 'wp-courseware' ),
			),
			'public'                => true,
			'publicly_queryable'    => true,
			'hierarchical'          => false,
			'show_ui'               => true,
			'show_in_nav_menus'     => false,
			'show_in_menu'          => true,
			'supports'              => array( 'title', 'editor', 'revisions' ),
			'has_archive'           => false,
			'rewrite'               => $permalinks['unit_rewrite_slug'] ? array( 'slug' => $permalinks['unit_rewrite_slug'], 'with_front' => false ) : false,
			'query_var'             => true,
			'map_meta_cap'          => true,
			'menu_position'         => WPCW_MENU_POSITION + 1,
			'can_export'            => true,
			'show_in_rest'          => true,
			'capability_type'       => 'wpcw_course_unit',
			'rest_base'             => $this->post_type_slug,
			'rest_controller_class' => 'WP_REST_Posts_Controller',
		) ) );
	}
public function post_type ( ) { $ permalinks = $ this -> get_permalinks ( ) ; register_post_type ( $ this -> post_type_slug , apply_filters ( 'wpcw_units_post_type_args' , array ( 'labels' => array ( 'name' => __ ( 'Units' , 'wp-courseware' ) , 'singular_name' => __ ( 'Unit' , 'wp-courseware' ) , 'all_items' => __ ( 'All Units' , 'wp-courseware' ) , 'new_item' => __ ( 'New Unit' , 'wp-courseware' ) , 'add_new' => __ ( 'Add New' , 'wp-courseware' ) , 'add_new_item' => __ ( 'Add New Unit' , 'wp-courseware' ) , 'edit_item' => __ ( 'Edit Unit' , 'wp-courseware' ) , 'view_item' => __ ( 'View Unit' , 'wp-courseware' ) , 'search_items' => __ ( 'Search Units' , 'wp-courseware' ) , 'not_found' => sprintf ( __ ( 'No units found. <a href="%s">Add a new unit</a>.' , 'learnpress' ) , admin_url ( 'post-new.php?post_type=course_unit' ) ) , 'not_found_in_trash' => __ ( 'No units found in trash' , 'wp-courseware' ) , 'parent_item_colon' => __ ( 'Parent Unit:' , 'wp-courseware' ) , 'menu_name' => __ ( 'Units' , 'wp-courseware' ) , ) , 'public' => true , 'publicly_queryable' => true , 'hierarchical' => false , 'show_ui' => true , 'show_in_nav_menus' => false , 'show_in_menu' => true , 'supports' => array ( 'title' , 'editor' , 'revisions' ) , 'has_archive' => false , 'rewrite' => $ permalinks [ 'unit_rewrite_slug' ] ? array ( 'slug' => $ permalinks [ 'unit_rewrite_slug' ] , 'with_front' => false ) : false , 'query_var' => true , 'map_meta_cap' => true , 'menu_position' => WPCW_MENU_POSITION + 1 , 'can_export' => true , 'show_in_rest' => true , 'capability_type' => 'wpcw_course_unit' , 'rest_base' => $ this -> post_type_slug , 'rest_controller_class' => 'WP_REST_Posts_Controller' , ) ) ) ; }
Register Course Units Post Type.
Register Course Units Post Type .