Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fatal error when Block Compatibility is off #1272

Merged
merged 2 commits into from Dec 14, 2023

Conversation

xxsimoxx
Copy link
Member

Some classes have polyfilled methods that call WP_Compat::using_block_function();.
But when Block Compatibility is set to "off" WP_Compat class is not defined.

See WS Form LITE blocks compatibility  post on the forum.

This PR adds a check for the class to exists in this way:

if ( class_exists( 'WP_Compat' ) ) {
	WP_Compat::using_block_function();
}

Docblock for WP_Compat::using_block_function has been updated to point out this.

How has this been tested?

  1. Install WS Form LITE
  2. Go to Posts -> All Posts
  3. Click on any of the posts titles
  4. No fatal error will show

Types of changes

  • Bug fix

@xxsimoxx xxsimoxx added this to the 2.0 milestone Dec 11, 2023
@ClassyBot
Copy link
Contributor

This pull request has been mentioned on ClassicPress Forums. There might be relevant details there:

https://forums.classicpress.net/t/ws-form-lite-blocks-compatibility/5039/2

@mattyrob mattyrob merged commit e63b63f into ClassicPress:develop Dec 14, 2023
10 checks passed
@xxsimoxx xxsimoxx deleted the fix/compat branch December 17, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants