Title: sunstate's Replies | WordPress.org

---

# sunstate

  [  ](https://wordpress.org/support/users/sunstate/)

 *   [Profile](https://wordpress.org/support/users/sunstate/)
 *   [Topics Started](https://wordpress.org/support/users/sunstate/topics/)
 *   [Replies Created](https://wordpress.org/support/users/sunstate/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/sunstate/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/sunstate/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/sunstate/engagements/)
 *   [Favorites](https://wordpress.org/support/users/sunstate/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress editor The editor has encountered an unexpected error.](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/)
 *  Thread Starter [sunstate](https://wordpress.org/support/users/sunstate/)
 * (@sunstate)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/page/2/#post-17397865)
 * [@artemiosans](https://wordpress.org/support/users/artemiosans/) Since version
   6.3.3 it works great as before, really thanks for your work
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress editor The editor has encountered an unexpected error.](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/)
 *  Thread Starter [sunstate](https://wordpress.org/support/users/sunstate/)
 * (@sunstate)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/page/2/#post-17291700)
 * [@artemiosans](https://wordpress.org/support/users/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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress editor The editor has encountered an unexpected error.](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/)
 *  Thread Starter [sunstate](https://wordpress.org/support/users/sunstate/)
 * (@sunstate)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/#post-17272954)
 * [@artemiosans](https://wordpress.org/support/users/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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress editor The editor has encountered an unexpected error.](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/)
 *  Thread Starter [sunstate](https://wordpress.org/support/users/sunstate/)
 * (@sunstate)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/#post-17188438)
 * [@artemiosans](https://wordpress.org/support/users/artemiosans/) Thank you, and
   I look forward to a resolution.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress editor The editor has encountered an unexpected error.](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/)
 *  Thread Starter [sunstate](https://wordpress.org/support/users/sunstate/)
 * (@sunstate)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/#post-17183951)
 * 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
 *     ```wp-block-code
       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](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wordpress editor The editor has encountered an unexpected error.](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/)
 *  Thread Starter [sunstate](https://wordpress.org/support/users/sunstate/)
 * (@sunstate)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/wordpress-editor-the-editor-has-encountered-an-unexpected-error/#post-17183378)
 * 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?
 *     ```wp-block-code
       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;
       }
       ```
   

Viewing 6 replies - 1 through 6 (of 6 total)