add_action( 'plugins_loaded', 'mytheme_remove_show_my_balance' );
function mytheme_remove_show_my_balance() {
if ( !current_user_can( 'administrator' ) ) {
remove_action( 'personal_options', array( $this, 'show_my_balance' ) );
}
}
The above is what I've tried and the following two files in the plugin contain the action that I wish to remove or otherwise block or disable:
https://github.com/mycred/myCRED/blob/master/includes/mycred-admin.php
https://github.com/mycred/myCRED/blob/master/modules/mycred-module-management.php
global $your_class_name;
inside the function to get access to the class object instance at all. And replacing$this
also with $your_class_name?remove_action()
to remove a hooked method of an instance of a class ($this), you should get that instance first! See this: remove_action or remove_filter with external classes?