The error describes WordPress attempting to execute an action resulting in Enqueue::css()
receiving too few arguments (it requires at least two).
In the constructor you are hooking Enqueue::css()
to the wp_enqueue_scripts
action. When wp_enqueue_scripts
is executed, it receives no additional arguments, so it calls Enqueue::css()
with no arguments, triggering the error.
Long story short, all of your methods in the Enqueue
class appear to be intended to enqueue scripts and stylesheets – there’s no reason to attach them to *_enqueue_scripts
action hooks. While functions hooked to those actions are an ideal place to enqueue scripts, hooking the functions which enqueue the scripts to them makes little sense – it is the equivalent of
add_action( 'wp_enqueue_scripts', 'wp_enqueue_script' );
The immediate solution is to remove all of the add_action()
calls from your constructor; longer-term the Enqueue
class’s functionality will need to be re-assessed.
Related Posts:
- How to enqueue script if widget is displayed on page?
- Why I can’t add a CSS style in this WordPress theme?
- The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme
- Is there a way to set the order of wp_footer hooked functions?
- What can I hook into after_setup_theme?
- What does “Do not deregister the jquery script in the administration area” mean?
- How do you enqueue script tags for ReactDOM in WordPress’ functions.php?
- using wp_enqueue_script to attach jquery-ui
- Enqueued Stylesheets Effecting Admin Styles
- wp_enqueue_script being ignored in custom theme
- Getting jquery to work with custom theme
- Is it safe to enqueue a font style without putting http or https?
- Adding wp_enqueue_media(); causes problem
- Is there a filter for enqueue script to strip the type=”text/javascript” property
- Including Javascript options
- Is my approach to enqueue styles inefficient?
- functions.php not hooking up with style.css
- way to include own functions independent of theme
- How to To Filter wp_enqueue_script() Scripts on Some Pages
- How to add Bootstrap Tour JavaScript to WordPress Admin Panel Dashboard Widget
- Difficulty loading jQuery with wp_enqueue_script
- jQuery not available to other scripts
- Can´t access child theme´s scripts dependencies found in parent
- How to modify default controls in WordPress theme customizer
- How to enqueue javascript for WP Customize options sidebar?
- Enqueued JavaScript is not working
- Overide enqueue in non plugable function via child theme
- How to register and enqueue JavaScript files without breaking plugin dependencies?
- How to enqueue a script which is type module without using script_loader_tag filter?
- Custom jquery not code not working in wordpress
- add jquery file if a certain page is included
- Adding google fonts to WordPress theme
- how can i remove js file from my footer in wordpress
- Find out the reason that the Styles and scripts in the theme are loading properly in localhost but Not in server after deploying
- Enqueue script for development purposes only?
- Correct was to customise theme using get_theme_mod in scripts
- how can I re-utilize and class on a child theme
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- enqueue script if page is not equal to
- Theme now uses require.js and enqueue script no longer works
- Enqueue script/style with multiple GET parameters
- What is the preferred way to add custom javascript files to the site?
- Should I use set_transient or update_option?
- Custom Taxonomy Tree view
- Best practice way to implement custom sections into a WordPress theme
- Add a preview to a WordPress Control Panel
- Change text of twentyseventeen_edit_link()
- How do I remove RSS feeds from themes?
- Advantages of using instead of wp_enqueue_style()?
- Style.css redirects to 404 Page not found
- How to add suggest plugin to theme?
- When developing a distributable Theme, does it HAVE to be “inheritable”?
- Prevent update check for specific theme
- Unhook jQuery from WooCommerce via `functions.php`? [closed]
- Free starter theme to make mobile websites? [closed]
- How can I make that when I clic on one of the menu items, that page shows only posts with the same category?
- Hide header texts (Title & Tagline) in custom-header.php
- Why an arugment is missing in wp_get_attachment_image_attributes?
- Archive page doesn’t work
- How to add “Template” option in page attributes panel?
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- How to enable thumbnails in RSS dashboard widget
- How to check if a WordPress core block is active in sidebar
- How can i attach the attachment-ID to the user profile image?
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- How can I fetch the WordPress cart errors normally displayed in woocommerce-error?
- wp_remote_get times out on api request but jquery GET and postman work?
- Folder name for a pro version of a WordPress.org theme?
- Remove settings if theme is deleted?
- Using WordPress’ Theme Customizer to select page templates that update layout in the preview
- what is the difference between uri and path?
- How to change footer or for different kinds of users in wordpress?
- Create a child theme from multiple themes
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- How to determine (via php) if site is using a static home page?
- Migrating to WordPress – but how will it do “structured” data?
- Why WordPress AJAX returns undefined however it works fine when I add static url instead of dynamic function?
- Adding a new setting using Kirki or WP customizer with an if statement
- Pagination: Keep prev and next link even on the first/ last page
- How to remove permalinks links presents in each page of my site?
- Is there a way to serve different resolution images to different devices?
- How to substitute old wordpress menu by wp 3 menu the right way?
- Why my theme option not working?
- How to use multiple check-box values to work in a function and insert values in database
- Catch the moment when theme is deleted
- Advanced method to control cache of enqueued style/script
- Attribute form NumberControl doesn’t update when I update page before it lose its focus
- create loop for the_content()
- how to change footer content for certain pages only
- function ‘theme_settings_page’ not found
- Should I use template files or just use conditional tags in index.php?
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- How can I include the js and css file of my custom theme dynamically in header.php
- WordPress Blog Page displaying nothing
- Full width thumbnail
- Set start page depending on screen width [closed]
- How can I change the title of the Home link in the navigation bar?
- Add option for administrator to submit link
- Display recent posts on front page
- Not Able to Access Terms Under Custom Taxonomy Archive