PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.21
Timetics – Appointment Booking Calendar & Scheduling v1.0.21
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 1.0.21, at base/taxonomy.php

76 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 /**
12 * Taxonomy Class.
13 *
14 * @since 1.0.0
15 */
16 abstract class Taxonomy {
17 /**
18 * Store taxonomy name
19 *
20 * @since 1.0.0
21 *
22 * @var string $name
23 */
24 protected $name;
25
26 /**
27 * Store custom post type
28 *
29 * @since 1.0.0
30 *
31 * @var string $cpt
32 */
33 protected $cpt;
34
35 /**
36 * Store taxonomy args.
37 *
38 * @since 1.0.0
39 *
40 * @var array $args
41 */
42 protected $args;
43
44 /**
45 * Taxonomy Constructor.
46 *
47 * @since 1.0.0
48 *
49 * @return void
50 */
51 public function __construct() {
52 $this->set_props();
53 add_action( 'init', [ $this, 'register_taxonomy' ] );
54 }
55
56 /**
57 * Regisetr custom taxonomy
58 *
59 * @since 1.0.0
60 *
61 * @return void
62 */
63 public function register_taxonomy() {
64 register_taxonomy( $this->name, $this->cpt, $this->args );
65 }
66
67 /**
68 * Set config
69 *
70 * @since 1.0.0
71 *
72 * @return void
73 */
74 abstract public function set_props();
75 }
76