Apparently PHPCS (link to issue) and WPCS (link to issue) do not work at this point with PHP8 and won’t until their next releases.
It’s therefore recommended to use PHP 7.4 instead.
“Hack” option
Before downgrading my system to PHP7, I tried this hack. It seems to work for me, at least for the brief testing I did. But it might cause any kinds of issues, so use it at you own risk.
Replacing the content of the local ControlStructureSpacingSniff.php
file
(in /WordPress/Sniffs/WhiteSpace/
of the cloned repo or the vendor folder of the composer installation) with the one from the develop
branch.
Related Posts:
- Why isn’t WordPress part of Framework Interop Group?
- When to use Exceptions vs Error Objects vs just plain false/null
- WordPress and event-driven programming – what is it about?
- PHPCS: Strings should have translatable content
- Is it better to create a function or a variable for current_theme_supports?
- Should I use wp_cache in my plugin to make it faster?
- How can one use variables in a template or template part without polluting the global scope?
- How to declare a global variable in php?
- Undefined variable in functions.php file [closed]
- load/require specific php files for specific pages/templates/post types
- Display message once per session to users with a specific role
- How to correct schedule my event weekly with wp_schedule_event()
- Execute a shortcode when clicking on a image
- get_the_content if it contains multiple lines it results in SyntaxError
- How can I add a class to a single menu item?
- WordPress returns a wrong date
- Store loop into array
- How to enlarge the media file upload size in wordpress admin
- How do I hardcode a WordPress shortcode into my theme?
- Show Specific Footer Widget for Specific Pages
- Debugging PHP object during Ajax call in WordPress
- Getting my head round WordPress filter
- allow user to select pages from dropdown in my plugin
- How to set a custom path, for ajax image upload folder in admin?
- Recent post display using shortcode
- How is WordPress manipulating the posts like there are folders?
- Can I use `.phtml` instead of `.php`
- conditional statement for custom taxonomy
- WP_cron won’t trigger my action
- how to save selection meta data in user profile on frontend
- How to get a list of all possible values of a specific user meta key?
- Use object in template part
- Can’t extend some core classes
- Output Buffering – Everything between wp_head and wp_print_footer_scripts?
- functions.php is being included twice, creating PHP fatal errors
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- Menu Limitations
- Iterate through posts based on array of categories
- selected option if current category is the value
- Custom query, checking values of multiple meta keys
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Genesis framework comments broken?
- Change CSS based on is_user_logged_in
- How to hook code to show after the_content?
- Run a code only on theme activation only during first activation
- Shortcode from a function not working
- How to make an embeded a Youtube video from custom field text responsive to screen size?
- Creating WordPress Shortcode with Variable
- Catchable fatal error: Object of class stdClass could not be converted to string
- Get title attribute from galleries
- How to add text to the start of all comments?
- If else statement to check for thumbnail and whether or not it’s a mobile device – streamline
- How can I use a sliced image As banner? [closed]
- Compare $_POST returned values with term array
- random display categories – change url
- Display child page content of a specific parent on home page
- Generate responsive post thumbnails of same size
- Change out put of the_post_thumbnail in PHP
- Styling an “active” link outside of WordPress default menu
- WordPress permalink issue
- Any way to hide a blog posts text if it’s longer than let’s say 300 characters
- Show label for value only when value exists, basic php
- Counting number of posts in multiple (sub)categories using shortcode
- Display WordPress search results based on the selected Sub-Category
- how to make wordpress user submit form once?
- Update PHP version of WordPress (internal hosting)
- Where to add my PHP codes for AJAX Jquery to work?
- Display the list of user’s comments + the post title + date
- Multiple Tag Filtering
- Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?
- How to optimize and reduce excessive database queries
- Need to show 7 posts from actual date
- How to reload a php script, using AJAX and jQuery
- Notice: Undefined variable
- Make wp_editor required
- Add the shortcodes from the enfold theme to the other theme
- PHP 7.2.18 | Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- I need to edit a widget, with no dashboard access
- How can i style “echo apply_filters”
- Get the total Author Favorited posts
- How to properly create multiple conditions to redirect users roles to different pages
- unable to add category in creating post dynamically
- making a search.php query
- WordPress WPDB::insert 13th param is always blank (only if format)
- Ajax not updating to database
- MySQL query in WordPress with AJAX
- enumerating custom taxonomies?
- Change colour of table td based on value
- Headers Already Sent
- Sum of Custom Meta written by Authour
- If or/and statement advanced custom fields [closed]
- Remove duplicates from foreach
- Determine if only one image attached to a post/page
- Add specific phrase after every product title including the discounted price? [closed]
- get_avatar from user id
- How do I change the Go To Categories link in the term_updated_messages
- wp_mail vs mail functions and header arrays
- WordPress get_the_term_list include class name for heirachy