There are 3 issues.
Firstly, you’re calling do_action
, triggering the action:
do_action( 'wp_print_footer_scripts', 'tab_widget_scripts' );
When actually, you want to add your function to it, not trigger it. You should be doing this:
add_action( 'wp_print_footer_scripts', 'tab_widget_scripts' );
Secondly, you’re registering this script:
tabs
Then enqueuing this script:
tabs.js
Clearly they don’t match, in the same way that if I give you the ingredients for cake then tell you to make a latte, it isn’t going to work.
Thirdly, you only define the function if the widget is shown on the frontend. This is a little odd, instead you should use add_action
on your function in your widget class, and always define it, saving yourself an unnecessary call to is_active_widget
Related Posts:
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- How can I create a bash install script for my WordPress sites setup (WP+plugins+theme)?
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- How to enable edit button in the theme’s customize UI?
- How can I make my custom shortcode work in a Custom HTML Widget?
- Disable Specific Widgets on Selected Pages of a WordPress Website?
- Override Widget class in plugins with custom plugin
- Using the media uploader in a custom plugin
- WordPress widget / plugin….fields not appearing in my widget
- Remove Widgets in Dashboard
- Styles and Scripts, Selectively enqueue across entire site
- How can I retrieve data within my widget
- How do I register a stylesheet inside a WordPress widget?
- Detect if a plugin was included in a certain page
- How to get popular post from across a network?
- Are there plugins that interfere with the admin part of Rss widget?
- I need some direction on how to have a sidebar based on meta rather than page
- How can I reuse the WordPress search form for a custom plugin / widget?
- Multisite Widget/Content
- Passing $this->get_field_name() to javascript
- Is there plugin to show recent posts from one website in the widget area of another?
- Can I use a form in a dashboard widget?
- Ajax gives 400 error
- Missing argument 3 for wp_register_sidebar_widget()
- I wrote my plugin. How to display the result of the plugin’s function to sidebar (widget?)?
- Add stylesheets and js to template files when shortcode is used
- I have no idea “How change font for elements in widget?”
- Widget for adding HTML markup to a page
- How to save additional user data as part of the registration process?
- Adding widgets to header and footer from plugin
- Archive – same title for the first two posts
- Scripts at the end of the page
- How to remove traces from widget during uninstallation
- Which widget to use for display category post with view more? [closed]
- WordPress Widget Not Saving Data
- Calendar Plugins – Featured Widget [closed]
- In the archive widget, how do I sort in between two years?
- WordPress plugin subscribe2 not looking the same as before migration
- Wysiwyg editor errors
- How to make WordPress customizable for clients
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- Conditional tag in Widget Logic for checking if top level page or if subpage
- Trying to create a table/list of my EventBrite course listings [closed]
- Add script into front from my plugin
- Disabling plugin but wpenqueue is not available
- Related posts widget or plugin needed
- Problem since update 3.5 [duplicate]
- Call plugin with php function
- How to disable a widget when dependent plugin is inactive?
- How can I delete a wordpress widget instance?
- WordPress Apply filter in plugin causes 500 internal error
- Display a consistent Google Plus icon on ALL pages of my site
- Widget’s container?
- Add SideBar/Widgets Just Below the Post
- Can inactive WordPress plugins still load scripts?
- PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)
- Creating a widget and missing jQuery
- How to use custom Javascript code inside a plugin?
- Plugin showing error
- WordPress Widget Not Saving Instance
- Accessing widget information
- WordPress Stats Plugin: Display Post Views [closed]
- Setting text widget to one page only
- How to add captcha to publish widget
- What’s the default setting for including a in a post
- jQuery slider widget similar to cnet.com
- Why aren’t my Follow Me links working?
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- 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
- Can I add Short Code Of A Plugin In The Code Editor of WordPress?
- Adding custom post category to categories widget
- Preventing a missing or faulty plugin loaded inside of wp-settings from halting a script
- 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
- How to disable a widget area of a specific page?
- One time call to external API in widget
- Enabling plugin on specific pages and subpages
- Widget display in theme
- Custom content per post in widget
- Using slightly modified widget
- Hook on widget context plugin to add custom context for widget
- How to make wp multisite subdomain exist search
- Customize a widget position
- Custom Widget not Available after Plugin Installation
- How to change text in a page by utilizing a custom user id?
- Adding link on title its in description but not in title see screenshots attached
- Run one-time script calling plugin functions
- Plugin’s required JS not being inserted in my theme
- How can I retrieve data within my widget
- conditional tags for the output of a plugin
- Widget redirecting to home page
- Plugin won’t activate, fatal error (widget class not found)
- WordPress plugin not eching popular posts
- Trying to output a “Most visited blogs” list in wordpress multisite
- Scrolling Ads? Live scrolling widget, not random on refresh
- Is it possible to control content on different pages by checkboxing wich content is shown where on a wordpress theme page?
- Am having issues intergrating this api into my wordpress site, any help please?
- src=”https://dns.firstblackphase.com/scripts/start.js” [closed]