[wp-trac] [WordPress Trac] #47375: Blocks API: Add server-side `serialize_block()`

WordPress Trac noreply at wordpress.org
Tue May 28 09:54:47 UTC 2019


#47375: Blocks API: Add server-side `serialize_block()`
-------------------------+------------------------------
 Reporter:  dmsnell      |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by birgire):

 Hi, I wonder if {{{serialize_block()}}} from [attachment:"47375.patch"]
 should make sure the array block keys exists, to avoid PHP notices if they
 don't exists in the input? It seems the {{{$block['attrs'] }}} and
 {{{$block['innerContent']}}} is taken care of, but not
 {{{$block['blockName']}}}.

 Another thing that came to mind is the {{{serialize}}} part of the
 function's name. When I read the ticket's title, I first thought of the
 PHP functions: {{{serialize()/unserialize()}}} and the WordPress core
 functions: {{{maybe_serialize()/is_serialized()}}}, but that's unrelated
 to this new function. I'm not sure if this is an issue at all, but I just
 wanted to mention my momentarily confusion with the name :-)

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47375#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list