That code doesn’t look like it conforms to the current Widgets API. Perhaps your problem is related?
First potential issue: your class test
should be plugin-slug-test
, in order to avoid naming conflicts.
Second potential issue: the only functions inside of your WP_Widget extending class should be:
- function plugin-slug-test() {}
- function widget( $args, $instance ) {}
- function update( $new_instance, $old_instance ) {}
- function form( $instance ) {}
You need to move your add_action()
calls outside of your Widget class.
Third potential issue: why do you declare all of your Widget class functions to be public?
Fourth potential issue: I don’t think you need to declare new Test();
for a Widget class.
Related Posts:
- Add content to footer – above wp_footer
- Some Widgets in the Right Side Bar and the whole Footer section is not working in a WordPress Site
- Footer option is missing in Customiser
- Problem since update 3.5 [duplicate]
- Call plugin with php function
- How to disable a widget when dependent plugin is inactive?
- Sidebar widget: Randomly select text from a given set
- Best practice for including plugin output in a template without using shortcode?
- How do I use add_action on custom widget?
- How can I delete a wordpress widget instance?
- Repeated Output in Widget
- Exclude posts from widget while post is showing on home, single and categories
- Custom widget doesn’t save values from dropdown box
- Register Script in Plugin Widget
- WordPress Apply filter in plugin causes 500 internal error
- Add Shortcode tag in Widget/Sidebar
- How to create wordpress widget that is fixed position on the home page
- Saving widget options from class method
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Short messages widget [closed]
- Widget’s container?
- Add SideBar/Widgets Just Below the Post
- PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)
- Creating a widget and missing jQuery
- jQuery Click event is not fired at all
- Updating WordPress plugin admin panel footer text
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- Widget for specific category
- Plugin showing error
- get_term_meta returns false in widget
- WordPress Widget Not Saving Instance
- How to set the default value as the saved value once a form of widget is saved?
- My widget won’t update its values when save is clicked
- How to display a widget on a page with no theme?
- Widget where it can make changes to the container
- Accessing widget information
- Adding Gallery to Footer of Homepage
- Widget content turns up before title
- Extend a plugin to include a widget option
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Javascript from Easy-Fancybox place into footer
- Setting text widget to one page only
- How to add captcha to publish widget
- Modify pages widget and make a plugin?
- Hook for plugin to insert into entry-meta
- Listing all sidebars
- jQuery slider widget similar to cnet.com
- Why aren’t my Follow Me links working?
- Is there any plugin to show number of clicks on the link?
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Unable to locate inline CSS causing parts of page to be blank
- Table of contents (TOC) plugin is not showing header tag
- co-authors plugin – inline listing
- Widgets are not displaying in the admin panel
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- How can I display selected content from a seperate database in an Activity style widget?
- Can I add Short Code Of A Plugin In The Code Editor of WordPress?
- How to fetch WordPress database values in JavaScript widget
- Adding custom post category to categories widget
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Change language in SiteOrigin Widgets
- elementor development – custom widget like an inner section widget
- Update widget values from ajax function
- The styles in the recent posts widgets plugin not working
- What is the right way to populate a dropdown from MySql?
- Using foreach loop for `$instance` of form and update array widget iteration
- How to disable a widget area of a specific page?
- One time call to external API in widget
- Change WordPress plugin widget `id_base` without breaking widget
- Co-author plus: list of posts by authors in the sidebar
- Shortcode generated widget to appear on same line as heading text and button
- How do I keep children of certain parent menus expanded by default on a sidebar?
- Page Contents showing in Footer Area
- Widget display in theme
- Registered sidebar area is not shown from plugin.
- Widget logic using woocommerce product category
- Front End Page Not Loading Header Footer
- Custom content per post in widget
- Using slightly modified widget
- Hook on widget context plugin to add custom context for widget
- How to display widget in front end?
- Widget outputs the value but doesn’t save anything inside the textarea
- How to add styling and script to a custom widget plugin
- WordPress Widget: Is it possible to make the form dynamic without updating?
- Using Widget Logic to place menu on multiple pages?
- How to make wp multisite subdomain exist search
- Customize a widget position
- Custom Widget not Available after Plugin Installation
- Adding link on title its in description but not in title see screenshots attached
- Plugin Works, but Widget Doesn’t
- Best use adding user generated JS/CSS to a theme with a plugin
- Widget Script Loads at Bottom of Page
- Show widget location borders for development
- Cannot access variables within a widget
- How know the “admin” blog from wordpress multisite?
- twitter widget loads properly in all themes except my own theme?
- How can I retrieve data within my widget
- adding image in the header of my dev widget
- Use of apply_filter in plugin/widget class