PluginProbe
WowAddons – Product Addons and Product Options With Custom Fields / trunk
WowAddons – Product Addons and Product Options With Custom Fields vtrunk
1.7.2 1.7.1 1.7.0 1.6.21 1.6.20 1.6.19 1.6.18 1.6.17 1.6.16 1.6.15 1.6.14 1.6.13 1.6.12 1.6.11 1.6.10 1.6.9 1.6.8 1.6.7 1.6.6 1.5.10 1.5.11 1.5.2 1.5.3 1.5.4 1.5.5 All 57 releases
product-addons / includes / class-post-type.php

class-post-type.php in WowAddons – Product Addons and Product Options With Custom Fields trunk, at includes/class-post-type.php

64 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php // phpcs:ignore
2 /**
3 * PostType Action.
4 *
5 * @package PRAD\Options
6 * @since v.1.0.0
7 */
8 namespace PRAD\Includes;
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * PostType class.
14 */
15 class PostType {
16
17 /**
18 * Setup class.
19 *
20 * @since v.1.0.0
21 */
22 public function __construct() {
23 add_action( 'init', array( $this, 'post_type_callback' ) );
24 }
25
26
27 /**
28 * Option PostType
29 *
30 * @since v.1.0.0
31 */
32 public function post_type_callback() {
33 $labels = array(
34 'name' => _x( 'Option', 'Option', 'product-addons' ),
35 'singular_name' => _x( 'Option', 'Option', 'product-addons' ),
36 'menu_name' => __( 'Option', 'product-addons' ),
37 'parent_item_colon' => __( 'Parent Option', 'product-addons' ),
38 'all_items' => __( 'Option', 'product-addons' ),
39 'view_item' => __( 'View Option', 'product-addons' ),
40 'add_new_item' => __( 'Add New', 'product-addons' ),
41 'add_new' => __( 'Add New', 'product-addons' ),
42 'edit_item' => __( 'Edit Option', 'product-addons' ),
43 'update_item' => __( 'Update Option', 'product-addons' ),
44 'search_items' => __( 'Search Option', 'product-addons' ),
45 'not_found' => __( 'No Option Found', 'product-addons' ),
46 'not_found_in_trash' => __( 'Not Option found in Trash', 'product-addons' ),
47 );
48 $args = array(
49 'labels' => $labels,
50 'show_in_rest' => true,
51 'supports' => array( 'title', 'editor' ),
52 'hierarchical' => false,
53 'public' => false,
54 'rewrite' => false,
55 'show_ui' => false,
56 'show_in_menu' => false,
57 'show_in_nav_menus' => false,
58 'exclude_from_search' => true,
59 'capability_type' => 'page',
60 );
61 register_post_type( 'prad_option', $args );
62 }
63 }
64