• Resolved streamworksaudio

    (@streamworksaudio)


    Hi, I am working on some custom code to extend Dokan’s functionality, I am trying to remove the action ‘load_inventory_template’ from the hook ‘dokan_product_edit_after_main’ – the standard remove_action code does not work…

    remove_action('dokan_product_edit_after_main', 'load_inventory_template' );

    Is the function in a class? If so, what is the class name?

    The code…

    remove_all_actions('dokan_product_edit_after_main');

    does work, but I just want to remove the inventory panel for the moment.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @streamworksaudio,

    This will not work as basic remove action. Since the action(hook) was added into a class. In that case, you have to use the class instance or class name.

    However, the following code works for me.

    add_action( 'init', 'dokan_remove_inventory_template_action');
    
    function dokan_remove_inventory_template_action() {
    	remove_action( 'dokan_product_edit_after_main', array( 'WeDevs\Dokan\Dashboard\Templates\Products' ,'load_inventory_template'), 5);
    }

    Cheers!

    • This reply was modified 4 years, 7 months ago by Arif_me.
    • This reply was modified 4 years, 7 months ago by Arif_me.
    Thread Starter streamworksaudio

    (@streamworksaudio)

    Thanks Arif,

    I will give this a shot. As I mentioned above, I was sure the function was in a class, but I couldn’t figure out which class it was in. I tried ‘Products’ by itself and that did not work. I will try ‘WeDevs\Dokan\Dashboard\Templates\Products’

    Cheers!

    Shafinoid

    (@shafinahmad01)

    Hello,
    I believe you are doing well,

    As you haven’t replied for a long, I’m considering that you have got the solution and I’m also resolving this topic.

    But feel free to create another one anytime.

    Stay Safe 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘remove action ‘load_inventory_template’’ is closed to new replies.