PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / trunk
Timetics – Appointment Booking Calendar & Scheduling vtrunk
1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 All 62 releases
timetics / base / taxonomy.php

taxonomy.php in Timetics – Appointment Booking Calendar & Scheduling trunk, at base/taxonomy.php

78 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Taxonomy Base Class
4 *
5 * @since 1.0.0
6 *
7 * @package Timetics
8 */
9 namespace Timetics\Base;
10
11 defined( 'ABSPATH' ) || exit;
12
13 /**
14 * Taxonomy Class.
15 *
16 * @since 1.0.0
17 */
18 abstract class Taxonomy {
19 /**
20 * Store taxonomy name
21 *
22 * @since 1.0.0
23 *
24 * @var string $name
25 */
26 protected $name;
27
28 /**
29 * Store custom post type
30 *
31 * @since 1.0.0
32 *
33 * @var string $cpt
34 */
35 protected $cpt;
36
37 /**
38 * Store taxonomy args.
39 *
40 * @since 1.0.0
41 *
42 * @var array $args
43 */
44 protected $args;
45
46 /**
47 * Taxonomy Constructor.
48 *
49 * @since 1.0.0
50 *
51 * @return void
52 */
53 public function __construct() {
54 $this->set_props();
55 add_action( 'init', [ $this, 'register_taxonomy' ] );
56 }
57
58 /**
59 * Regisetr custom taxonomy
60 *
61 * @since 1.0.0
62 *
63 * @return void
64 */
65 public function register_taxonomy() {
66 register_taxonomy( $this->name, $this->cpt, $this->args );
67 }
68
69 /**
70 * Set config
71 *
72 * @since 1.0.0
73 *
74 * @return void
75 */
76 abstract public function set_props();
77 }
78