Public Ticket #3449487

Remove copy_data action

Closed
Comments
5 Tickets 3
Nicholas started the conversation 3 years ago on September 1, 2023 at 12:52pm

Hi there,

We need to prevent the copy_data action hook from running when a subaccount is created as this is overriding our custom subaccount shipping fields data.

We have tried:

remove_action('b2bking_after_subaccount_created', array($b2bking_public, 'b2bking_copy_data'), 10, 1);

This is not working however.

Please advise.

Nick

2,762
KingsPlugins replied 3 years ago on September 2, 2023 at 12:09am

Hi Nick,

I looked into this and you should be able to remove that by adding this PHP code snippet to your site:

global $b2bking_plugin;
remove_action('b2bking_after_subaccount_created', array($b2bking_plugin, 'b2bking_copy_data'), 10, 1);
add_action('plugins_loaded', function(){
    global $b2bking_plugin;
    remove_action('b2bking_after_subaccount_created', array($b2bking_plugin, 'b2bking_copy_data'), 10, 1);
});

I've tested it on my local site and it is working in my tests,


Kind regards,

Stefan

Sign In