-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
5.1.1: PHP Fatal error: Uncaught Error: Call to undefined function use_block_editor_for_post() in wp-content/plugins/gutenberg/lib/register.php:36 #14012
Comments
I have same problem. Guttenberg should check the functions if they exist before using them |
Actually I cannot view orders in Woocommerce and reset password and other things. Bug is in Guttenberg. |
Which WordPress version are you using? |
5.0.3 |
cc @aduth I guess we're using this function in a context where it's not loaded? |
I don't think we can expect this; rather, only in a wp-admin context. It's not clear, but from where are you seeing the errors? Regardless, I see two outcomes:
This may look something like: require_once ABSPATH . 'wp-admin/includes/post.php'
if ( use_block_editor_for_post( $post ) ) {
// ...
} |
Frontend rendering
OK probably not a huge deal, then. Classic Editor plugin for one seems to lag catching up w/ removing |
|
Fix at #14096 To be clear, these functions are still deprecated, and still will be removed in Gutenberg 5.3. Plugin authors should transition to the core-equivalent |
Describe the bug
It's related to deprecated
gutenberg_can_edit_post()
.I was using Toolset Views conditional shortcode like follows:
[wpv-conditional if="( gutenberg_can_edit_post( [wpv-post-id] ) )"]
This, very recently (either core 5.1rc2, or Gutenberg plugin 5.1.0 release) started crashing, after working error free for nearly a year.
Traceback:
Expected behavior
gutenberg_can_edit_post()
should be able to forward touse_block_editor_for_post()
from all angles.Additional context
It's weird, because
use_block_editor_for_post()
is defined inwp-admin/includes/post.php
and I would expect that to be always loaded, right...?The text was updated successfully, but these errors were encountered: