You simply need to run your code on a higher priority than what the parent theme is, the default on add_action
function is 10 so you can use:
function s157343_unregister_widgets() {
unregister_widget( 'Chocolat_Widget_New_Entrys' );
}
add_action( 'widgets_init', 's157343_unregister_widgets', 20 );
This will unregister that widget. Of course, you can still create a new class that extends that widget’s class to override the methods you want and register a new widget based on that:
class my_Chocolat_Widget_New_Entrys extends Chocolat_Widget_New_Entrys() {
public function __construct() {}
public function widget( $args, $instance ) {}
}
add_action( 'widgets_init', create_function( '', 'return register_widget( "my_Chocolat_Widget_New_Entrys" );' ) );
Related Posts:
- How to override parent functions in child themes?
- overwrite code snippet from parent to child theme
- Adding a second email address to a completed order in WooCommerce [closed]
- Child theme – Overriding ‘require_once’ in functions.php
- How to override a function when isn’t at functions.php
- Declaring an instance of class included in parent theme from child theme functions.php
- Removing custom background and header feature in child theme
- override parent theme configuration in child functions.php
- syntax for remove_filter in parent theme with class
- Override parent theme function that is not hooked or in the functions.php file
- How to override filter in child theme?
- add sidebar area to header of child theme
- Should I ask a theme developer to use locate_template rather than require_once
- Using the child theme functions.php to change the customizer.php on parent theme
- override parent theme configuration in child functions.php
- Proper way of using functions in action hook?
- Avoid loading css from parent theme
- How can I change a function in a parent theme via a child themes functions.php
- How to load parent theme template parts in child theme
- How would I go about replacing this function in my child theme located in inc/template-tags.php
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- get_template_directory_uri() links to child theme not parent
- Solution dealing with Child Theme / Parent theme functions
- Removing parent theme CSS without editing parent theme
- How to override this theme function in child theme
- How do I create a child theme from PowerMag theme
- Override parent theme function that is not hooked or in the functions.php file
- Problem with Child-Theme using of foundation-framework [closed]
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- remove_action on after_setup_theme not working from child theme
- Include files in child theme functions file
- Redeclare a function in a child theme
- Child theme functions.php do I use php open and close tags?
- One Child Functions.php for Multiple Child Themes
- How to override function in functions.php of parent theme?
- Implementing DNS Prefetching with WordPress
- Child theme – overriding add_image_size by a child theme [duplicate]
- Do all files in child theme override the parent?
- How to override functions.php in child theme?
- How to prevent deleting of comments when deleting a post
- Overriding core functions in child theme
- Convert hyphen to underscore in permalinks
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Reuse variable in hook callback
- Child theme – copied some files from parent to child website still uses parent files
- I created a child theme and it doesn’t work for some of the css files
- Unregister Nav Menu with fallback?
- Child Theme Not Overriding Parent Theme
- Changes to functions.php not working
- Overriding methods in a child theme
- How to override enqueued styles using a child theme
- Customized wp_new_user_notification
- change default option in wp_dropdown_categories
- What is the criteria for pluggable functions?
- Child theme functions.php not executing
- How to store / access files in child theme folder
- Make “sidebar template” the default template for new pages
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- Overwrite Parent Theme add_image_size in Child Theme
- Twenty Eleven Child theme error when attempting to use a rewritten function
- How do I get a child theme to load scripts from the parent theme?
- how to edit functions.php in a child theme
- Load parent theme files before child theme functions.php
- Best practice when altering a parent theme function inside a child theme?
- How to make child theme inherit parent custom theme options [closed]
- Will dequeueing in child theme functions.php file prevent Google Fonts from loading?
- Child Theme not loading multiple stylesheets
- WordPress reading old version of functions.php, breaks site
- Including admin-options.php file in Child Themes
- Modified functions.php in Magazine Pro theme of Genesis. 500 error
- Help with is_page() and calling css for specific pages in a Child Theme
- uninstall a theme programmaticlly
- Providing fallback function and allow override by plugin
- How do I integrate my Child Theme into a Custom Template?
- Getting back a blank WordPress site following functions code edit
- Adding a meta box fields to child theme options page
- Child Theme functions.php has no effect
- Update add_image_size
- Removing get_template_part in child theme
- Integrate WP Tiles into existing loop (index.php) and theme
- Load a Child Theme’s style.css just before the closing tag
- save_post hook – headers already sent?
- Is it possible to change parameters of Parent theme function in the Child theme?
- Preventing PHP Execution in Parent Theme
- Blank child theme – functions.php problem
- Why does my visual post editor break when I try to add a TinyMCE button?
- Functions.php in child theme that loads CSS file breaks website
- unregister_sidebar in child theme not working
- Unregistering custom tinymce plugin?
- Child Theme not working – CSS gone
- Why functions metaboxes is causing White Screen in Admin [closed]
- How do I make my child theme’s CSS update when I save it?
- How to fix enqueue_styles error for a twenty-seventeen childtheme
- post_row_actions filter from parent theme not executing in child theme
- How can I edit the wp_parse_auth_cookie function from the pluggable file in my functions?
- Proper way to load styles using a child theme
- Child theme’s functions.php not being read (child theme’s autoload.php not being run)