#45037 closed task (blessed) (fixed)
Improve the WordPress Post editing experience
Reported by: | jorbin | Owned by: | pento |
---|---|---|---|
Milestone: | 5.0 | Priority: | highest omg bbq |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | fixed-5.0 |
Focuses: | Cc: |
Description
It would be Guten for WordPress to have a more modern editing experience. People on Bergs all over the world would benefit from this. And so would people in lowlands. Block parties could be held in celebration. It would even lay a foundation for a new and improved way for WordPress to be built.
Attachments (5)
Change History (33)
This ticket was mentioned in โSlack in #core by jorbin. โView the logs.
6 years ago
This ticket was mentioned in โSlack in #core-js by aduth. โView the logs.
6 years ago
This ticket was mentioned in โSlack in #core by jorbin. โView the logs.
6 years ago
#7
@
6 years ago
- Keywords has-patch needs-testing added; needs-patch removed
45037.diffโ enables the block editor as the default editor.
It requires the patch from #45112 to function, and will throw JS errors (which are annoying, but don't prevent testing) until #43316 and โGB#6694 are resolved.
#9
@
6 years ago
45037.2.diffโ is a little adjustment on 45037.diffโ that:
- Adds inline filter documentation for:
apply_filters( 'enter_title_here', __( 'Add title', 'gutenberg' ), $post )
apply_filters( 'write_your_story', __( 'Write your story', 'gutenberg' ), $post )
apply_filters( 'default_page_template_title', __( 'Default template', 'gutenberg' ), 'rest-api' )
- Removes the
'gutenberg'
text domain. - Changes
@since 3.7.0
to@since 5.0.0
- Adds space in:
// Ensure the global $post remains the same afterAPI data is preloaded.
- Inline documents the global
$editor_styles
;
Some other notes on 45037.diffโ :
- Would be nice to explain this in more detail:
// It hurts to do this.
- Check if we can use
get_avatar_url()
instead of:$avatar = get_avatar( $user_id, 64 ); if ( $avatar ) { if ( preg_match( "|src='([^']+)'|", $avatar, $matches ) ) { $user_details['avatar'] = $matches[1]; } }
- It's not clear to me how the global
$post
can be modified here:
// Ensure the global $post remains the same after API data is preloaded. $backup_global_post = $post; $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Restore the global $post as it was before API preloading. $post = $backup_global_post;
- Can we move inline CSS style into an existing CSS file:
<div id="metaboxes" style="display: none;">
or maybe there's an existing CSS class for the closed state? - Both
json_encode()
andwp_json_encode()
used.
#10
@
6 years ago
Thank you for the review, @birgire! I'm working on this locally at the moment, but I've implemented all of your adjustments, and addressed your notes. ๐
#13
@
6 years ago
45037.3.diffโ is the latest version of the patch that enables the block editor. Basic usage should work, the notable exception here is reusable blocks. There are probably other bugs related to the various open tickets. ๐
#14
@
6 years ago
45037.4.diffโ fixes a bug with autosaves. Now that reusable blocks have landed, it should be pretty solid.
#15
follow-up:
โย 16
@
6 years ago
Update: The JS error described here below was fixed in #45158 - I just verified that.
@pento great, thank you for the update.
I tested the latest patch, but I get
The editor has encountered an unexpected error.
It shows three buttons:
Attempt Recovery Copy Post Text Copy Error
The buttons didn't give any direct text feedback (a possible future ticket?) when pressing on them.
The "Attempt Recovery" button didn't solved the issue though.
The "Copy Error" button did copy to the clipboard the following error:
TypeError: Cannot read property 'length' of undefined at i (http://wp.test/wp-includes/js/dist/date.min.js?ver=5.0-alpha-20181023.101317:1:3777) at d (http://wp.test/wp-includes/js/dist/date.min.js?ver=5.0-alpha-20181023.101317:1:4419) at http://wp.test/wp-includes/js/dist/editor.min.js?ver=5.0-alpha-20181023.101317:55:210644 at Ug (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:90:242) at Vg (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:92:379) at Kf (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:118:136) at Lf (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:118:472) at jc (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:127:342) at aa (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:126:505) at ta (http://wp.test/wp-includes/js/dist/vendor/react-dom.min.js?ver=5.0-alpha-20181023.101317:124:298)
and strangely the "Copy Post Text" button did also copy the error but not the post text.
I also noticed with an earlier patch that the date-picker seemed to be missing some CSS?
But I suspect these errors might just be related to my own install, but I post them here just in case :-)
It seems that Gutenberg will make this call:
file_get_contents( 'https://fonts.googleapis.com/css?family= Libre+Franklin%3A300%2C300i%2C400%2C400i%2C600%2C600i%2C800%2C800i&subset=latin%2Clatin-ext' )
I wonder if site owners are informed about this external call?
This might also be blocked, if the allow_url_fopen
support is turned off. The check true == ini_get( 'allow_url_fopen' )
comes also to mind.
#16
in reply to:
โย 15
@
6 years ago
Replying to birgire:
I tested the latest patch, but I get
The editor has encountered an unexpected error.
I haven't been able to reproduce this error, can you confirm a few things for me?
- Did you run
npm install
andgrunt webpack:dev
sincesvn up
-ing your 5.0 branch? - Is this on new posts, editing posts, or does it only happen occasionally?
- Have you cleared your browser cache?
It seems that Gutenberg will make this call:
file_get_contents( 'https://fonts.googleapis.com/css?family= Libre+Franklin%3A300%2C300i%2C400%2C400i%2C600%2C600i%2C800%2C800i&subset=latin%2Clatin-ext' )I wonder if site owners are informed about this external call?
Libre Franklin is the editor font that Twenty Seventeen uses. I just confirmed that using โa plugin that disables Google Fonts will also stop this from loading.
This might also be blocked, if the
allow_url_fopen
support is turned off. The checktrue == ini_get( 'allow_url_fopen' )
comes also to mind.
Good point, I'll switch it to wp_remote_get()
instead.
#18
@
6 years ago
- Keywords fixed-5.0 added
Marking this one as fixed, please open new tickets to report bugs.
This ticket was mentioned in โSlack in #core-privacy by birgire. โView the logs.
6 years ago
#21
@
6 years ago
- Keywords fixed-5.0 removed
Reopening this, because we cannot add a is_block_editor()
method that is both a setter, and a getter.It goes against long established WordPress conventions, and fundamental rules of API design.
Using set_is_block_editor()
or get_is_block_editor()
keeps in line with the original method name. set_uses_block_editor()
or get_uses_block_editor()
might be cleaner. The reason being that get_is_
is a doubled prefix. is_
in WordPress is used for helper functions that access a particular piece of data, without offering a setter, so it's not the best naming choice in this case.
#22
@
6 years ago
Thank you for the patch, @Frank-Klein.
Given how close we are to 5.0, renaming ::is_block_editor()
isn't an option. I'm not particularly fussed whether it acts as a setter or not, which makes me lean towards not changing it.
An alternative option would be to provide an is_block_editor()
function (in the style of is_admin()
, which returns the value of $GLOBALS['current_screen']->is_block_editor()
, but doesn't offer the setter functionality.
#23
@
6 years ago
- Keywords fixed-5.0 added; early needs-unit-tests has-patch needs-testing removed
Marking this one as fixed. We can follow up in a new ticket if there's demand for a different API.
lib/register.php
has functions related to initializing the new editor. These should be merged into core.