PluginProbe
WP Ultimate Post Grid / 3.5.0
WP Ultimate Post Grid v3.5.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / includes / public / class-wpupg-post-type.php

class-wpupg-post-type.php in WP Ultimate Post Grid 3.5.0, at includes/public/class-wpupg-post-type.php

59 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Register the Grid post type.
4 *
5 * @link https://bootstrapped.ventures
6 * @since 3.0.0
7 *
8 * @package WP_Ultimate_Post_Grid
9 * @subpackage WP_Ultimate_Post_Grid/includes/public
10 */
11
12 /**
13 * Register the Grid post type.
14 *
15 * @since 3.0.0
16 * @package WP_Ultimate_Post_Grid
17 * @subpackage WP_Ultimate_Post_Grid/includes/public
18 * @author Brecht Vandersmissen <brecht@bootstrapped.ventures>
19 */
20 class WPUPG_Post_Type {
21
22 /**
23 * Register actions and filters.
24 *
25 * @since 3.0.0
26 */
27 public static function init() {
28 add_action( 'init', array( __CLASS__, 'register_post_type' ), 1 );
29 }
30
31 /**
32 * Register the Link post type.
33 *
34 * @since 3.0.0
35 */
36 public static function register_post_type() {
37 $labels = array(
38 'name' => _x( 'Grids', 'post type general name', 'wp-ultimate-post-grid' ),
39 'singular_name' => _x( 'Grid', 'post type singular name', 'wp-ultimate-post-grid' ),
40 );
41
42 $args = apply_filters( 'wpupg_register_post_type', array(
43 'labels' => $labels,
44 'public' => false,
45 'rewrite' => false,
46 'capability_type' => 'post',
47 'query_var' => false,
48 'has_archive' => false,
49 'show_in_rest' => true,
50 'rest_base' => WPUPG_POST_TYPE,
51 'rest_controller_class' => 'WP_REST_Posts_Controller',
52 ));
53
54 register_post_type( WPUPG_POST_TYPE, $args );
55 }
56 }
57
58 WPUPG_Post_Type::init();
59