1 | <?php |
||
10 | class Term_Meta_Datastore extends Meta_Datastore { |
||
11 | /** |
||
12 | * ID of the term. |
||
13 | * |
||
14 | * @var int |
||
15 | */ |
||
16 | protected $term_id; |
||
17 | |||
18 | /** |
||
19 | * Initialization tasks. |
||
20 | **/ |
||
21 | public function init() { |
||
36 | |||
37 | /** |
||
38 | * Create term meta database table (for WP < 4.4) |
||
39 | **/ |
||
40 | public static function create_table() { |
||
68 | |||
69 | /** |
||
70 | * Delete term meta on term deletion. |
||
71 | * Useful for WP < 4.4. |
||
72 | * |
||
73 | * @param int $term_id Term ID. |
||
74 | * @return bool Result of the deletion operation. |
||
75 | */ |
||
76 | public static function on_delete_term( $term_id ) { |
||
84 | |||
85 | /** |
||
86 | * Retrieve the type of meta data. |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | public function get_meta_type() { |
||
93 | |||
94 | /** |
||
95 | * Retrieve the meta table name to query. |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | public function get_table_name() { |
||
103 | |||
104 | /** |
||
105 | * Retrieve the meta table field name to query by. |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public function get_table_field_name() { |
||
112 | |||
113 | /** |
||
114 | * Set the term ID of the datastore. |
||
115 | * |
||
116 | * @param int $term_id ID of the term. |
||
117 | */ |
||
118 | public function set_id( $term_id ) { |
||
121 | |||
122 | /** |
||
123 | * Retrieve the term ID of the datastore. |
||
124 | * |
||
125 | * @return int ID of the term. |
||
126 | */ |
||
127 | public function get_id() { |
||
130 | |||
131 | } |
||
132 |