• Resolved Hassan Hossinie

    (@onlinerir)


    Hi, In the previous versions, I would disable the actions here:

    remove_action('dokan_dashboard_right_widgets', array(Dokan_Template_Dashboard::init(), 'get_sales_report_chart_widget'), 10 );

    But in version 3.0 this code is error
    Because of changes in the core

    Fatal error
    : Uncaught Error: Call to undefined method Dokan_Template_Dashboard::init() in F:\xampp\htdocs\newkala44\wp-content\plugins\dokan-plus-plus\classes\class-dashboard.php:57 Stack trace: #0 F:\xampp\htdocs\newkala44\wp-includes\class-wp-hook.php(288): SHH_DOKAN_PLUS_PLUS_Dashboard->remove_widgets_dashboard(”) #1 F:\xampp\htdocs\newkala44\wp-includes\class-wp-hook.php(312): WP_Hook->apply_filters(”, Array) #2 F:\xampp\htdocs\newkala44\wp-includes\plugin.php(478): WP_Hook->do_action(Array) #3 F:\xampp\htdocs\newkala44\wp-content\plugins\dokan-lite\templates\dashboard\dashboard.php(24): do_action(‘dokan_dashboard…’) #4 F:\xampp\htdocs\newkala44\wp-content\plugins\dokan-lite\includes\functions.php(893): include(‘F:\\xampp\\htdocs…’) #5 F:\xampp\htdocs\newkala44\wp-content\plugins\dokan-lite\includes\Shortcodes\Dashboard.php(84): dokan_get_template_part(‘dashboard/dashb…’) #6 F:\xampp\htdocs\newkala44\wp-includes\shortcodes.php(325): WeDevs\Dokan\Shortcodes\Dashboard->render_shortcode(”, ”, ‘dokan-dashboard’)

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hello @onlinerir,

    I am really sorry for the trouble you are having. Dokan version 3.0.0 is released with a refactored coding structure, this new version will make your experience with Dokan smoother than before. Unfortunately, we have deprecated some class on the code. So any changes using the class may affect the site.

    You can use simple CSS to hide options to get the issue resolved. If there is any modification on the child theme using class, we suggest you revert the change and check. The plugin should work fine. Please rever the changes and let us know if the issue remains with the default code of the plugin.

    Best Regards.

    I get the same problem, and would like to use remove_action, how can we do this for that same example:
    remove_action('dokan_dashboard_right_widgets', array(Dokan_Template_Dashboard::init(), 'get_sales_report_chart_widget'), 10 );

    I get the same problem, and would like to use remove_action, how can we do this for that same example:
    remove_action('dokan_dashboard_left_widgets', array(Dokan_Template_Dashboard::init(), 'get_big_counter_widgets'), 10 );
    how can we do this .

    ANSWER FAST PLS.

    Hello @saeedf436 ,

    Due to the changes in our core files, the way of accessing the class and objects has also changed. You can use this piece of code to remove that widget –

    add_action('init', function() {
        remove_action( 'dokan_dashboard_left_widgets', array( dokan()->dashboard->templates->dashboard, 'get_big_counter_widgets'));
    });

    Thank you.

    Hello @rur165,

    There is still an issue in removing action hooks. I am trying to remove settings action hooks but it’s not working

    
    add_action('init', 'remove_my_action');
    function remove_my_action()
    {
       remove_action('dokan_settings_content_area_header', array(dokan()->dashboard->templates->settings, 'render_settings_help'), 99);
       remove_action('dokan_settings_content_area_header', array(dokan()->dashboard->templates->settings, 'render_settings_load_progressbar'), 99);
    }
    

    Would you please check it?

    Thanks

    • This reply was modified 4 years, 2 months ago by rigal-patel.
    • This reply was modified 4 years, 2 months ago by rigal-patel.

    Hello @rigal-patel ,

    Our developers suggest that you have to use the hooks like this from now:

    /**
     * Remove some hooks from Dokan dashboard settings page
     */
    function dokan_remove_settins_content_header_some_methods() {
        dokan_remove_hook_for_anonymous_class( 'dokan_settings_content_area_header', \WeDevs\Dokan\Dashboard\Templates\Settings::class, 'render_settings_help', 15 ); 
        dokan_remove_hook_for_anonymous_class( 'dokan_settings_content_area_header', \WeDevs\Dokan\Dashboard\Templates\Settings::class, 'render_settings_load_progressbar', 20 ); 
    }
    add_action( 'init', 'dokan_remove_settins_content_header_some_methods', 99 );

    Thank you.

    Thread Starter Hassan Hossinie

    (@onlinerir)

    Thank you very much everyone

    Hi @onlinerir

    Sorry for interrupting. I just saw ur topic, Kindly I have a small query: Remove action u are using it for what exactly? to remove the widget?

    Hello @rur165 ,

    Still, It’s not working. I added remove action in child theme function.php but getting a fatal error.

    
    /**
     * Remove store setting hooks
     */
    
    function dokan_remove_settins_content_header_some_methods() {
      dokan_remove_hook_for_anonymous_class( 'dokan_settings_form_bottom', \WeDevs\DokanPro\Modules\StoreSupport::Module, 'add_support_btn_title_input', 13 ); 
    }
    add_action( 'init', 'dokan_remove_settins_content_header_some_methods', 99 );
    

    Error:

    Uncaught Error: Class ‘WeDevs\DokanPro\Modules\StoreSupport’ not found in /var/www/html/thecloset/wp-content/themes/yozi-child/functions.php

    Would you please check it and let me know how to fix this issue?

    Hello @rigal-patel ,

    This hook is from Dokan Pro. Please contact through the support channel for any queries related to Dokan Pro. We will try our best to suggest a solution according to our support policy.

    www.remarpro.com forum rules do not allow us to make discussion on paid features. I hope this is understandable.

    Thank you ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘problem by remove action’ is closed to new replies.