Remove action inside Class constructor
-
Hi there,
I need to remove an action added inside a Class constructor without resorting to editing plugin files but have had no luck so far.
The action I am trying to remove is located on line 23 of wc-vendors/classes/admin/class-admin-users.php and is the following:
add_action( 'edit_user_profile', array( $this, 'show_extra_profile_fields' ) );
Here is what I have tried so far to no avail in my theme’s functions.php file:
add_action( 'wp_head', 'remove_wc_vendors_actions' ); function remove_wc_vendors_actions() { if ( is_callable( array( $WCV_Admin_Users, 'show_extra_profile_fields' ) ) ) { global $WCV_Admin_Users; remove_action( 'edit_user_profile' , array( $WCV_Admin_Users, 'show_extra_profile_fields' ) ); } }
add_action( 'wp_head', 'remove_wc_vendors_actions' ); function remove_wc_vendors_actions() { if ( is_callable( array( 'WCV_Admin_Users', 'show_extra_profile_fields' ) ) ) { remove_action( 'edit_user_profile' , array( 'WCV_Admin_Users', 'show_extra_profile_fields' ) ); } }
add_action( 'wp_head', 'remove_wc_vendors_actions' ); function remove_wc_vendors_actions() { if ( is_callable( 'WCV_Admin_Users::show_extra_profile_fields' ) ) { remove_action( 'edit_user_profile', 'WCV_Admin_Users::show_extra_profile_fields' ); } }
Please could you provide code to remove this action?
Many thanks,
Isabel
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Remove action inside Class constructor’ is closed to new replies.