[wp-trac] [WordPress Trac] #33473: Shortcodes + Widgets + Nav Menus. Unified "component" API (aka Content Blocks)

WordPress Trac noreply at wordpress.org
Fri Apr 7 14:50:14 UTC 2017

#33473: Shortcodes + Widgets + Nav Menus. Unified "component" API (aka Content
 Reporter:  brentjett@…      |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  4.8
Component:  Widgets          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  ux-feedback      |     Focuses:  ui

Comment (by overclokk):

 I read all thread and I think this is very interesting.

 This is what I do now for widget and shortcode and I can use them in post
 content and/or sidebars when I need to show the view, I have a single
 class for handling the view of the block, that class works standalone and
 works injected in a `My_Widget_Class` and in a `My_Shortcode_Class` as
 well (`My_Widget_Class` and `My_Shortcode_Class` are very little classes,
 just for handling shortcodes and widgets integration).

 The parameters accepted are the same, but shortcodes also accept a second
 parameter for `$content`, in widget you don't need `$content`.

 Having the shortcode pre-registered is a good idea like oembed does (it
 save the embed in post meta).

 I would add also the oembed to this proposal because it does the same
 thing, inject a block (iframe) view into content like shortcodes does.

 Those are my 2cent

Ticket URL: <https://core.trac.wordpress.org/ticket/33473#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list