[wp-trac] [WordPress Trac] #56941: Fatal error produced by block using closure as render_callback

WordPress Trac noreply at wordpress.org
Tue Nov 1 07:54:07 UTC 2022


#56941: Fatal error produced by block using closure as render_callback
--------------------------+-----------------------------
 Reporter:  andrewleap    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Themes        |    Version:  6.1
 Severity:  blocker       |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The following code causes site to blow up on front and in post editor


 {{{
 register_block_type(
         __DIR__,
         array(
                                      // attempted to serialize closure
                 'render_callback' => function( $attributes, $content,
 $block ){}
         )
 );


 }}}


 Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed
 in /app/wp-includes/block-supports/elements.php...

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56941>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list