Think about it, why would WordPress do anything just because you have defined additional class?
It’s not magic (neither magical magic or code driven magic). The text widget doesn’t appear simply because class exists. When WordPress loads it runs wp_widgets_init()
, which executes register_widget('WP_Widget_Text')
.
So technically you cannot tell it to use different class. What you can do is unregister the native class and register your own. As long as your class outputs same name and settings it will be practically indistinguishable from native widget.
Related Posts:
- Hook called before text widget save
- How to allow PHP In WordPress text widget
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Widgets not showing in my custom theme
- database interactions using OOP
- How to add just one specific page to widget without plugin?
- How to make widget title accept php?
- Widget back end radio button issue
- Check class_exists before class definition / Doxygen problem
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- PHP Helper Class to create shortcodes
- Inserting a class on before_widget if checkbox is checked
- Widget header unique classes
- Edit the Publish Widget Options
- is_user_logged_in returning nothing on custom page
- Customize field names in backend profile edit page through function.php [duplicate]
- Get options from database using php class
- Editor capabilities – admin_init
- how to add datas in taxonomy to post with wp_insert_post
- Don’t display a sidebar widget when on a specific page
- Site DOES NOT LOAD after 3.1 update
- WP insert post Redirect after function has executed
- Some problems in custom widget
- Create condition for Author bio Social Links
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- Change permalink structure specific category
- OOP PHP class extends TwentyTwenty_Customize in Child Theme
- Array data not saving to specified sections. How to make seting independantly?
- WP_REST_Response – How to return Gzip answer and add Content-encoding header?
- Customizer control save then return to default
- Create Columns with Custom Walker and CSS Classes
- WP-Bakery – Add custom colors to buttons with template colors
- add_action in namespace not working
- I need to display posts in subcategory beside posts in main category
- How do you create a custom category widget that you can style?
- How can I add diffrent editable text fields?
- Call to “admin_notices” hook from a static method
- How can I check that the acf field value is not a duplicate when adding a post?
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
- Integrate otp in my custom singup form
- How a HTML form can trigger a PHP function?
- Retrieve the whole widget sidebar and pass it inside an html
- Woocommerce template file outputting tags
- Hide A Class and Add Custom HTML Code Using WordPress
- Featured image in menu wordpres
- Trying to update Woocommerce meta values
- How to run php code only for a specific widget on a page and not all widgets on that page?
- How do I know if the user is a customer?
- How to use wp_get_attachment_image or wp_get_attachment_image_src instead of $instance[‘single_feature_image_uri’]
- How to block specific user id in custom login form?
- Loading Widgets Via Child Theme
- Use PHP Class in WordPress functions
- update_user_meta as multiple value but with same meta key
- How to stop hiding buttons forward / backward in pagination?
- I want to fusion the product columns in email table order
- retrieve “Link Color” value
- If Statement is Ignored?
- Add a new view on the Woocommerce account page
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Current WordPress Page Title as Search Parameter into A Tag
- Delete post meta by serialized meta value
- can I extend the WP_Query class to deal with ‘duplicate’ posts created by joining to wp_posts?
- How do I add a predefined class to a custom html element?
- How to create a widget with a populated dropdown?
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- How to identify which php file a plugin is using on page load?
- dashboard widget form not submit mails
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Dynamic “home” image and URL based on current folder
- Dynamic Banner Text based on Subdomain
- Add widget area from visual editor
- Create “blank” admin page without having admin-bar/admin-menu for faster load
- Access variable from another class that was passed in constructor
- How to add typehints to function in functions.php when argument is an object?
- Need help transforming echo to return for use with shortcode
- Proper use of Output Buffer for a whole php clas
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- Noob question: want to remove the “site identity” logo for specific part of website only
- Create Schema in WordPress with PHP
- Redirect after login depending on the URL
- Create form which redirects to site in network?
- How to make a “page-option” in WordPress
- Redirect user role to a specific page on login in a multisite network?
- How to add a full working piece of website already coded, to a large scale Website design project?
- Redirecting the lost password page request when using a custon login page
- Add custom attribute to product’s HTML to woocommerce cart page
- Create custom admin page with custom text fields
- Autoloading Classes in Plugins
- Remove specific javascript when viewing page in Customizer?
- Priority call methods – PHPMailer->addAddress(NULL)
- Search only for posts with specific metadata?
- I need to edit a widget, with no dashboard access
- is_user_logged_in() not working in homepage
- Running local copy of an old WordPress site on MAMP
- Dynamic_sidebar load in string makeup
- Remove node from multisites?
- missing admin bar and widget in a template
- Automatically refresh page if widget is added to page?
- Customizing the output of the archive and category widget without altering the original behavior of the widget