Customize file on inc folder on child theme

Although it is a bit old post, there are some possible solutions:

  1. For your specific problem, since the only difference I see from the original widget is that you do not need the “tab3” regarding the recent comments and since each div has its own id, you can easily put in your css something like:

    #tab3 {display:none;}
    
  2. Now, regarding the override of the widget.

    • If you have access to the parent theme, you can wrap the widget in an if statement like:

      if(!class_exists('TheWorld_Tabs_Widget')) { 
         class TheWorld_Tabs_Widget extends WP_Widget {...
         ...
      }
      

      then, your widget will override the parent one and no error will be thrown.

      • If you do not have access to the parent theme, you can make a small change to your version of the widget by changing the name to something else (e.g.: TheWorld_Tabs_Widget_Child), and then use this to your theme.

      OR

      • try to unregister the parent widget first, by using the unregister_widget() function, in your child theme functions file. This assumes that the widget in the parent theme is registered at the widget_init.
        like:

        function some_widget_unregister() {
            unregister_widget( 'TheWorld_Tabs_Widget' );
        }
        add_action( 'widgets_init', 'some_widget_unregister', 99 );
        

tech