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
- Function to return true if current page has child pages
- Get author full name
- Integrating WordPress to my website, while keeping my own authentication system
- Display posts by month
- How to preserve PHP modifications while upgrading WordPress?
- Removing jQuery migrate and working with dependencies
- How to get the registered sidebar’s name by its id?
- is there a simple way to list every templates / php files used to generate a specific page?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Edit postmeta when user changes user role?
- OOP Plugin Development. Including external object
- Authenticating to WordPress, using my own authentication two-factor system
- How to add default images into theme customizer image control?
- Show Specific Footer Widget for Specific Pages
- PHP contact form returns warning in text widget [closed]
- WordPress Ajax Data problem
- Remove all nav menu classes ( but keep useful ones… )
- Class ‘WP_Widget’ not found
- nowplaying.include.php Will Not Display Results
- Widget Javascript code (ajax)
- Add attribute / custom attribute to product in woocommerce
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- Extend a class of a plugin
- I can’t get my custom widget area to show on my WordPress site
- How to run PHP code in Text Widget with no plugin in WP 4.4
- WordPress widget/sidebar dividers?
- Displaying theme options in css
- Use object in template part
- Hide wordpress field if data is empty in post!
- Customizer – Prefix Class Extension
- Create onClick Event to Re-load a Widget
- How to put a variable in a instance in the widget
- How to output widget
- WordPress blog post url on category page
- Changing layout with wp_customise
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Trying to build simple deposit code that hooks into woocommerce
- user_profile_update_errors hook not executing
- get widget number from array dynamically
- Saving and Restoring a Canvas on A Individual User Basis
- Extend plugin Class through functions.php
- Adding a widget function into the php theme file
- Output custom field value to post string
- Need help enqueueing webfonts
- If has $title in widgets
- Custom Background by Page IDs
- How to obtain the current website URL in my theme?
- Underscore – Self hosted fonts
- Undefined method class::construct() when creating a plugin
- Echo title attribute php
- str_replace with the_content is not working
- Widgets not showing on custom theme
- My website is not showing Footer section
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- How to use title attributes in sidebar widget?
- List of Events with Multiple Dates: Only NEXT Date
- Set cookie for visitor
- Display movies that apear this day next
- Get options from database using php class
- Array data not saving to specified sections. How to make seting independantly?
- Integrate otp in my custom singup form
- How a HTML form can trigger a PHP function?
- Hide A Class and Add Custom HTML Code Using WordPress
- How do I know if the user is a customer?
- How to block specific user id in custom login form?
- I want to fusion the product columns in email table order
- How to create a widget with a populated dropdown?
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Dynamic “home” image and URL based on current folder
- Add custom attribute to product’s HTML to woocommerce cart page
- Autoloading Classes in Plugins
- I need to edit a widget, with no dashboard access
- Automatically refresh page if widget is added to page?
- PHP: Why does my code work in index.php but not a widget?
- Widget edit and add in any page
- Slider from different widgets
- How can I show only if custom field has content [closed]
- media-uploader insert into post is not inserting
- How to hide something from custom home page with php code?
- Using existing widget code! [closed]
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- Using a loop to build and update widgets
- Display a list of users with avatar filterable with alphabets
- How does one programmatically manage posts from a external php script?
- How to remove the intro animation which appears during the load up of some WordPress themes? [closed]