I use this plugin. Is for auto expire user on specific date.
I want to add this action add_action(‘edit_user_profile’, array($this, ‘extra_user_profile_fields’)) when is_admin only because i have a conflict with an other plugin. I have try this to source code:
if (is_admin) {
add_action('edit_user_profile', array($this, 'extra_user_profile_fields'))
}
and all work well! But i want to add a function to child theme.
class Expire_User_Admin
{
var $settings = null;
public function __construct()
{
$this->settings = new Expire_User_Settings();
// Admin Actions
add_action('admin_init', array($this, 'expire_user_now'));
// Profile Fields
add_action('show_user_profile', array($this, 'extra_user_profile_fields'));
add_action('edit_user_profile', array($this, 'extra_user_profile_fields'));
add_action('user_new_form', array($this, 'user_new_form'));
...
}
So i have try this with no luck. Any thoughts?
add_action('init', 'remove_plugin_action', 9999);
function remove_plugin_action()
{
$plugin_class = new Expire_User_Admin();
remove_action('edit_user_profile', array($plugin_class, 'extra_user_profile_fields'));
if (is_admin()) {
add_action('edit_user_profile', array($plugin_class, 'extra_user_profile_fields'));
}
}
Go to Source
Author: xiamtoula