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

Support for WordPress 5.0 and the new editor #30

Open
bobbingwide opened this issue Mar 16, 2018 · 4 comments
Open

Support for WordPress 5.0 and the new editor #30

bobbingwide opened this issue Mar 16, 2018 · 4 comments
Assignees
Labels
enhancement Gutenberg Enhancement to support the new block editor Priority A High priority work

Comments

@bobbingwide
Copy link
Owner

Since early 2017 a new Block editor has been under development. Code named Gutenberg this new editor is being developed as a feature plugin. It is expected to be merged into core for WordPress 5.0.

Over time, more content will be created using the Block editor than the Classic editor.
The new solution needs to be backward compatible with our existing solution, so there shouldn’t be a need to change anything and it should still work. But that has not yet proven to be the case.
Also, over time, more content will be created/edited using the Block editor than the Classic editor.
We need to embrace the improvements.

So, rather than being compatible with Gutenberg we need to be Gutenberg aware.

For oik-fields there are two areas.

  1. Fields which rely on JavaScript to be displayed in meta boxes
  2. Fields which will need to be accessible in the Block editor through the REST API.
Area Problem Reference
show_in_rest oik-fields does not support show_in_rest
Google map virtual field requires Google Maps JavaScript
Show_in_rest Not all data can be exposed using the REST API Security

Non functional requirements

  • The solutions implemented for oik-types and oik-fields should be logically consistent.
  • Where possible the code should use shared library logic
  • New code should be tested
  • Code should be internationalised and localized
  • It should not cause Notices or Warnings, even when WP_DEBUG is true
  • Backward compatibility with WordPress 4.9.x as a minimum
  • Tested with PHP 7.1 and 7.2
@bobbingwide bobbingwide added enhancement Gutenberg Enhancement to support the new block editor Priority A High priority work labels Mar 16, 2018
@bobbingwide bobbingwide self-assigned this Mar 16, 2018
@bobbingwide
Copy link
Owner Author

There's a third area. Fields which already produce unexpected messages when the content is displayed as part of the [bw_field] or [bw_fields] shortcode.

@bobbingwide
Copy link
Owner Author

There's a third area. Fields which already produce unexpected messages when the content is displayed as part of the [bw_field] or [bw_fields] shortcode.

Problems detected are
email field without a value produces

Warning: strlen() expects parameter 1 to be string, array given in C:\apache\htdocs\wordpress\wp-includes\formatting.php on line 2502

Notice: Array to string conversion in C:\apache\htdocs\wordpress\wp-content\plugins\oik\shortcodes\oik-email.php on line 92

Media field produces
Fatal error: Uncaught Error: Call to undefined function bw_thumbnail() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-media\includes\oik-media.inc:62

@bobbingwide
Copy link
Owner Author

WordPress 5.0 was released on 6th December 2018. The latest version of oik-fields does co-exist peacefully with WordPress 5.0 and Gutenberg 4.8. There are some instances where updates to post meta fields, performed server side, are not reflected in the Block editor display. You need to reload the editor to see the changes.

@bobbingwide
Copy link
Owner Author

As part of the fix for bobbingwide/oik#120 I prototyped a change to the bw_metadata() function that supports the [bw_fields] shortcode. It calls oik_is_shortcode_expansion_necessary() to determine if oik thinks it's worth expanding shortcodes.

It's not caused any problems that I'm aware of so I'm happy to commit it... with oik-fields dependent upon oik v3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Gutenberg Enhancement to support the new block editor Priority A High priority work
Projects
None yet
Development

No branches or pull requests

1 participant