77 * @package Cbx\Taxonomy
88 * @since 1.0.0
99 */
10- class CBXTaxonomy {
10+ class CBXTaxonomy
11+ {
1112
1213 /**
1314 * @var null
@@ -32,13 +33,15 @@ class CBXTaxonomy {
3233 *
3334 * @since 1.0.0
3435 */
35- public function __construct () {
36- $ this ->version = CBXTAXONOMY_PLUGIN_VERSION ;
36+ public function __construct ()
37+ {
38+ $ this ->version = CBXTAXONOMY_PLUGIN_VERSION ;
3739 $ this ->plugin_name = CBXTAXONOMY_PLUGIN_NAME ;
3840
3941 //$this->unit_testing();
4042 $ this ->load_orm ();
4143 $ this ->load_plugin_textdomain ();
44+ $ this ->hooks = new Hooks ();
4245 }//end of method constructor
4346
4447 /**
@@ -47,8 +50,9 @@ public function __construct() {
4750 * @return CBXTaxonomy
4851 * @since 1.0.0
4952 */
50- public static function instance () {
51- if ( is_null ( self ::$ instance ) ) {
53+ public static function instance ()
54+ {
55+ if (is_null (self ::$ instance )) {
5256 self ::$ instance = new self ();
5357 }
5458
@@ -60,53 +64,56 @@ public static function instance() {
6064 *
6165 * @since 1.0.0
6266 */
63- public function load_plugin_textdomain () {
64- load_plugin_textdomain ( 'cbxtaxonomy ' , false , CBXTAXONOMY_ROOT_PATH . 'languages/ ' );
67+ public function load_plugin_textdomain ()
68+ {
69+ load_plugin_textdomain ('cbxtaxonomy ' , false , CBXTAXONOMY_ROOT_PATH . 'languages/ ' );
6570 }//end method load_plugin_textdomain
6671
6772 /**
6873 * Load ORM using helper class
6974 *
7075 * @since 1.0.0
7176 */
72- public function load_orm () {
77+ public function load_orm ()
78+ {
7379 $ taxonomy_helper = new CBXTaxonomyHelper ();
74- add_action ( 'init ' , [ $ taxonomy_helper , 'load_orm ' ] );
80+ add_action ('init ' , [$ taxonomy_helper , 'load_orm ' ] );
7581 } // end of load_orm
7682
7783 /**
7884 * Run test hooks
7985 *
8086 * @since 1.0.0
8187 */
82- public function unit_testing () {
83- if ( CBXTAXONOMY_DEV_MODE ) {
84- add_action ( 'cbxtaxonomy_taxable_delete_before ' , [
88+ public function unit_testing ()
89+ {
90+ if (CBXTAXONOMY_DEV_MODE ) {
91+ add_action ('cbxtaxonomy_taxable_delete_before ' , [
8592 $ this ,
8693 'cbxtaxonomy_taxable_delete_before_test '
87- ], 10 , 3 );
88- add_action ( 'cbxtaxonomy_taxable_delete_after ' , [ $ this , 'cbxtaxonomy_taxable_delete_after_test ' ], 10 , 3 );
89- add_action ( 'cbxtaxonomy_taxable_delete_failed ' , [
94+ ], 10 , 3 );
95+ add_action ('cbxtaxonomy_taxable_delete_after ' , [$ this , 'cbxtaxonomy_taxable_delete_after_test ' ], 10 , 3 );
96+ add_action ('cbxtaxonomy_taxable_delete_failed ' , [
9097 $ this ,
9198 'cbxtaxonomy_taxable_delete_failed_test '
92- ], 10 , 3 );
99+ ], 10 , 3 );
93100
94- add_action ( 'cbxtaxonomy_taxonomy_delete_before ' , [
101+ add_action ('cbxtaxonomy_taxonomy_delete_before ' , [
95102 $ this ,
96103 'cbxtaxonomy_taxonomy_delete_before_test '
97- ], 10 , 3 );
98- add_action ( 'cbxtaxonomy_taxonomy_delete_after ' , [
104+ ], 10 , 3 );
105+ add_action ('cbxtaxonomy_taxonomy_delete_after ' , [
99106 $ this ,
100107 'cbxtaxonomy_taxonomy_delete_after_test '
101- ], 10 , 3 );
102- add_action ( 'cbxtaxonomy_taxonomy_delete_failed ' , [
108+ ], 10 , 3 );
109+ add_action ('cbxtaxonomy_taxonomy_delete_failed ' , [
103110 $ this ,
104111 'cbxtaxonomy_taxonomy_delete_failed_test '
105- ], 10 , 3 );
112+ ], 10 , 3 );
106113
107- add_action ( 'cbxtaxonomy_taxonomy_save_before ' , [ $ this , 'cbxtaxonomy_taxonomy_save_before_test ' ], 10 , 2 );
108- add_action ( 'cbxtaxonomy_taxonomy_save_after ' , [ $ this , 'cbxtaxonomy_taxonomy_save_after_test ' ], 10 , 2 );
109- add_action ( 'cbxtaxonomy_taxonomy_save_failed ' , [ $ this , 'cbxtaxonomy_taxonomy_save_failed_test ' ], 10 , 2 );
114+ add_action ('cbxtaxonomy_taxonomy_save_before ' , [$ this , 'cbxtaxonomy_taxonomy_save_before_test ' ], 10 , 2 );
115+ add_action ('cbxtaxonomy_taxonomy_save_after ' , [$ this , 'cbxtaxonomy_taxonomy_save_after_test ' ], 10 , 2 );
116+ add_action ('cbxtaxonomy_taxonomy_save_failed ' , [$ this , 'cbxtaxonomy_taxonomy_save_failed_test ' ], 10 , 2 );
110117 }
111118 } // end of unit_testing
112119
@@ -119,9 +126,10 @@ public function unit_testing() {
119126 *
120127 * @since 1.0.0
121128 */
122- public function cbxtaxonomy_taxable_delete_before_test ( $ taxonomy_id , $ type , $ data ) {
123- if ( function_exists ( 'write_log ' ) ) {
124- write_log ( 'before taxable delete hook $taxonomy_id= ' . $ taxonomy_id . ' $type= ' . $ type );
129+ public function cbxtaxonomy_taxable_delete_before_test ($ taxonomy_id , $ type , $ data )
130+ {
131+ if (function_exists ('write_log ' )) {
132+ write_log ('before taxable delete hook $taxonomy_id= ' . $ taxonomy_id . ' $type= ' . $ type );
125133 }
126134 }//end of cbxtaxonomy_taxable_delete_before_test
127135
@@ -134,9 +142,10 @@ public function cbxtaxonomy_taxable_delete_before_test( $taxonomy_id, $type, $da
134142 *
135143 * @since 1.0.0
136144 */
137- public function cbxtaxonomy_taxable_delete_after_test ( $ taxonomy_id , $ type , $ data ) {
138- if ( function_exists ( 'write_log ' ) ) {
139- write_log ( 'before taxable delete hook $taxonomy_id= ' . $ taxonomy_id . ' $type= ' . $ type );
145+ public function cbxtaxonomy_taxable_delete_after_test ($ taxonomy_id , $ type , $ data )
146+ {
147+ if (function_exists ('write_log ' )) {
148+ write_log ('before taxable delete hook $taxonomy_id= ' . $ taxonomy_id . ' $type= ' . $ type );
140149 }
141150
142151 }//end of cbxtaxonomy_taxable_delete_after_test
@@ -150,9 +159,10 @@ public function cbxtaxonomy_taxable_delete_after_test( $taxonomy_id, $type, $dat
150159 *
151160 * @since 1.0.0
152161 */
153- public function cbxtaxonomy_taxable_delete_failed_test ( $ taxonomy_id , $ type , $ data ) {
154- if ( function_exists ( 'write_log ' ) ) {
155- write_log ( 'before taxable delete hook $taxonomy_id= ' . $ taxonomy_id . ' $type= ' . $ type );
162+ public function cbxtaxonomy_taxable_delete_failed_test ($ taxonomy_id , $ type , $ data )
163+ {
164+ if (function_exists ('write_log ' )) {
165+ write_log ('before taxable delete hook $taxonomy_id= ' . $ taxonomy_id . ' $type= ' . $ type );
156166 }
157167
158168 }//end of cbxtaxonomy_taxable_delete_failed_test
@@ -166,9 +176,10 @@ public function cbxtaxonomy_taxable_delete_failed_test( $taxonomy_id, $type, $da
166176 *
167177 * @since 1.0.0
168178 */
169- public function cbxtaxonomy_taxonomy_delete_before_test ( $ id , $ type , $ data ) {
170- if ( function_exists ( 'write_log ' ) ) {
171- write_log ( $ id . " here is the id => " . $ type );
179+ public function cbxtaxonomy_taxonomy_delete_before_test ($ id , $ type , $ data )
180+ {
181+ if (function_exists ('write_log ' )) {
182+ write_log ($ id . " here is the id => " . $ type );
172183 }
173184 }//end of cbxtaxonomy_taxonomy_delete_before_test
174185
@@ -181,9 +192,10 @@ public function cbxtaxonomy_taxonomy_delete_before_test( $id, $type, $data ) {
181192 *
182193 * @since 1.0.0
183194 */
184- public function cbxtaxonomy_taxonomy_delete_after_test ( $ id , $ type , $ data ) {
185- if ( function_exists ( 'write_log ' ) ) {
186- write_log ( $ id . " here is the id => " . $ type );
195+ public function cbxtaxonomy_taxonomy_delete_after_test ($ id , $ type , $ data )
196+ {
197+ if (function_exists ('write_log ' )) {
198+ write_log ($ id . " here is the id => " . $ type );
187199 }
188200 }//end of cbxtaxonomy_taxonomy_delete_after_test
189201
@@ -196,9 +208,10 @@ public function cbxtaxonomy_taxonomy_delete_after_test( $id, $type, $data ) {
196208 *
197209 * @since 1.0.0
198210 */
199- public function cbxtaxonomy_taxonomy_delete_failed_test ( $ id , $ type , $ data ) {
200- if ( function_exists ( 'write_log ' ) ) {
201- write_log ( $ id . " here is the id => " . $ type );
211+ public function cbxtaxonomy_taxonomy_delete_failed_test ($ id , $ type , $ data )
212+ {
213+ if (function_exists ('write_log ' )) {
214+ write_log ($ id . " here is the id => " . $ type );
202215 }
203216 }//end of cbxtaxonomy_taxonomy_delete_failed_test
204217
@@ -210,11 +223,12 @@ public function cbxtaxonomy_taxonomy_delete_failed_test( $id, $type, $data ) {
210223 *
211224 * @since 1.0.0
212225 */
213- public function cbxtaxonomy_taxonomy_save_before_test ( $ type , $ data ) {
214- if ( function_exists ( 'write_log ' ) ) {
215- write_log ( "taxonomy save here is the id => " . $ type );
226+ public function cbxtaxonomy_taxonomy_save_before_test ($ type , $ data )
227+ {
228+ if (function_exists ('write_log ' )) {
229+ write_log ("taxonomy save here is the id => " . $ type );
216230 } else {
217- error_log ( "taxonomy save here is the id => " . $ type );
231+ error_log ("taxonomy save here is the id => " . $ type );
218232 }
219233 }//end of cbxtaxonomy_taxonomy_save_before_test
220234
@@ -226,9 +240,10 @@ public function cbxtaxonomy_taxonomy_save_before_test( $type, $data ) {
226240 *
227241 * @since 1.0.0
228242 */
229- public function cbxtaxonomy_taxonomy_save_after_test ( $ type , $ data ) {
230- if ( function_exists ( 'write_log ' ) ) {
231- write_log ( "taxonomy save here is the id => " . $ type );
243+ public function cbxtaxonomy_taxonomy_save_after_test ($ type , $ data )
244+ {
245+ if (function_exists ('write_log ' )) {
246+ write_log ("taxonomy save here is the id => " . $ type );
232247 }
233248 }//end of cbxtaxonomy_taxonomy_save_after_test
234249
@@ -240,9 +255,10 @@ public function cbxtaxonomy_taxonomy_save_after_test( $type, $data ) {
240255 *
241256 * @since 1.0.0
242257 */
243- public function cbxtaxonomy_taxonomy_save_failed_test ( $ type , $ data ) {
244- if ( function_exists ( 'write_log ' ) ) {
245- write_log ( "taxonomy save here is the id => " . $ type );
258+ public function cbxtaxonomy_taxonomy_save_failed_test ($ type , $ data )
259+ {
260+ if (function_exists ('write_log ' )) {
261+ write_log ("taxonomy save here is the id => " . $ type );
246262 }
247263 }//end of cbxtaxonomy_taxonomy_save_failed_test
248264
0 commit comments