sunstate
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: wordpress editor The editor has encountered an unexpected error.@artemiosans Since version 6.3.3 it works great as before, really thanks for your work
Forum: Fixing WordPress
In reply to: wordpress editor The editor has encountered an unexpected error.@artemiosans Thank you, so I’ll wait for the next non-maintenance point release, but if there is an update, how can I identify if it’s a non-maintenance point release?
Forum: Fixing WordPress
In reply to: wordpress editor The editor has encountered an unexpected error.@artemiosans
I’ve updated to WordPress 6.4.2, but I’m still getting the same error, is it possible that the fix hasn’t been implemented yet?Forum: Fixing WordPress
In reply to: wordpress editor The editor has encountered an unexpected error.@artemiosans Thank you, and I look forward to a resolution.
Forum: Fixing WordPress
In reply to: wordpress editor The editor has encountered an unexpected error.the same code works fine for headings and paragraphs, but core/image seem to have a problem, I’ve attached the code I used in the same way
if ( ! function_exists( 'add_newheading_edit_block_metadata' ) ) { function add_newheading_edit_block_metadata($metadata) { // Center core/heading if ($metadata['name'] == 'core/heading') { $metadata['attributes']['textAlign']['default'] = 'center'; } return $metadata; } } add_filter('block_type_metadata', 'add_newheading_edit_block_metadata', 10, 2); if ( ! function_exists( 'addedlovely_edit_block_metadata' ) ) { function addedlovely_edit_block_metadata($metadata) { // Center core/paragraph if ($metadata['name'] == 'core/paragraph') { $metadata['attributes']['align']['default'] = 'center'; } return $metadata; } } add_filter('block_type_metadata', 'addedlovely_edit_block_metadata', 10, 2);
Forum: Fixing WordPress
In reply to: wordpress editor The editor has encountered an unexpected error.After upgrading to version 6.4, when I enter Add New Post and then enter the Editor screen, I get this error, I checked functions.php and it seems to be caused by the following code I put in function.php before $metadata[‘attributes’][‘align’][‘default’] = ‘center’; when I use that part, I start getting errors from 6.3 and the rest of the code doesn’t seem to be a problem I think I just need to change one line to 6.3 compatible code, do you know anything about it?
add_filter( 'block_type_metadata', 'set_image_auto_centre' ); function set_image_auto_centre( $metadata ) { if ( 'core/image' !== $metadata['name'] ) { return $metadata; } $metadata['attributes']['align']['default'] = 'center'; return $metadata; }