@@ -50,7 +50,7 @@ public static function init () {
5050 self ::$ role_objects = array ();
5151 self ::$ role_names = array ();
5252 foreach ( self ::$ roles as $ role ) {
53- self ::$ role_objects [$ role ->slug ] = new MPT_Role ( $ role ->slug , (array ) get_term_taxonomy_meta ( $ role ->term_taxonomy_id , 'capabilities ' , true ) );
53+ self ::$ role_objects [$ role ->slug ] = new MPT_Role ( $ role ->slug , (array ) get_term_meta ( $ role ->term_id , 'capabilities ' , true ) );
5454 self ::$ role_names [$ role ->slug ] = $ role ->name ;
5555 }
5656
@@ -86,7 +86,7 @@ public static function add_role( $role, $display_name, $capabilities = array() )
8686 $ term = get_term ($ term_result ['term_id ' ], MPT_TAXO_NAME );
8787
8888 // Update term meta with capabilities
89- update_term_taxonomy_meta ( $ term_result [ ' term_taxonomy_id ' ] , 'capabilities ' , $ capabilities );
89+ update_term_meta ( $ term -> term_id , 'capabilities ' , $ capabilities );
9090
9191 // Refresh values
9292 self ::$ roles [$ term ->slug ] = $ term ;
@@ -133,7 +133,7 @@ public static function add_cap( $role, $cap, $grant = true ) {
133133 return false ;
134134
135135 // Get current capabilities
136- $ capabilities = get_term_taxonomy_meta ( self ::$ roles [$ role ]->term_taxonomy_id , 'capabilities ' , true );
136+ $ capabilities = get_term_meta ( self ::$ roles [$ role ]->term_id , 'capabilities ' , true );
137137 if ( $ capabilities == false ) {
138138 $ capabilities = array ();
139139 }
@@ -142,7 +142,7 @@ public static function add_cap( $role, $cap, $grant = true ) {
142142 $ capabilities [$ cap ] = $ grant ;
143143
144144 // Save new capabilities
145- update_term_taxonomy_meta ( self ::$ roles [$ role ]->term_taxonomy_id , 'capabilities ' , $ capabilities );
145+ update_term_meta ( self ::$ roles [$ role ]->term_id , 'capabilities ' , $ capabilities );
146146
147147 // Refesh variable
148148 self ::$ role_objects [$ role ] = new MPT_Role ( $ role , $ capabilities );
@@ -163,7 +163,7 @@ public static function remove_cap( $role, $cap ) {
163163 return false ;
164164
165165 // Get current capabilities
166- $ capabilities = get_term_taxonomy_meta ( self ::$ roles [$ role ]->term_taxonomy_id , 'capabilities ' , true );
166+ $ capabilities = get_term_meta ( self ::$ roles [$ role ]->term_id , 'capabilities ' , true );
167167 if ( $ capabilities == false ) {
168168 $ capabilities = array ();
169169 }
@@ -172,7 +172,7 @@ public static function remove_cap( $role, $cap ) {
172172 unset($ capabilities [$ cap ]);
173173
174174 // Save new capabilities
175- update_term_taxonomy_meta ( self ::$ roles [$ role ]->term_taxonomy_id , 'capabilities ' , $ capabilities );
175+ update_term_meta ( self ::$ roles [$ role ]->term_id , 'capabilities ' , $ capabilities );
176176
177177 // Refesh variable
178178 self ::$ role_objects [$ role ] = new MPT_Role ( $ role , $ capabilities );
@@ -193,7 +193,7 @@ public static function remove_all_caps( $role ) {
193193 return false ;
194194
195195 // Save new
196- update_term_taxonomy_meta ( self ::$ roles [$ role ]->term_taxonomy_id , 'capabilities ' , array () );
196+ update_term_meta ( self ::$ roles [$ role ]->term_id , 'capabilities ' , array () );
197197
198198 // Refesh variable
199199 self ::$ role_objects [$ role ] = new MPT_Role ( $ role , array () );
0 commit comments