[wp-trac] [WordPress Trac] #45218: On Custom Widget Page: Title and Content missing when Text Widget is added to Widget area

WordPress Trac noreply at wordpress.org
Mon Oct 29 05:13:05 UTC 2018


#45218: On Custom Widget Page: Title and Content missing when Text Widget is added
to Widget area
--------------------------+-----------------------------
 Reporter:  limvus        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  TinyMCE       |    Version:  4.9.8
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Situation:
 I have a theme that has multiple dynamic layouts ( 'front-page', 'single',
 'archive' ).
 These layouts are widgetized as below.
 front-page -> widget area 1, widget area 2
 single -> widget area 3
 archive -> widget area 4, widget area 5

 The layouts have different page slug and depending upon the page slug,
 only the related widget areas are shown so that it will be easier for
 users to customize layouts. The layouts simply uses the wordpress
 'includes/widgets.php' and customizes the layouts for better user
 experience.

 Now, the problem is when I try to add text-widget to these areas, text-
 widget is added but I cannot see the title and content field.

 If I access the widgets from '/widgets.php' then everything works, but its
 of no use to me as I want nice widgetized custom layout pages.

 I thought this might be my theme issue but i copied '/admin/widgets.php'
 to '/admin/widgets-test.php' and accessed the page but the same issue
 occurred.

 This issue is appearing on wordpress >= 4.8 where visual editor is added
 to text-widget.

 I looked at the core and found out that on versions >= 4.8, text-
 widgets.js is required but this hook:
 do_action( "admin_print_scripts-{$hook_suffix}" );
 which is responsible for enqueuing the script, is only enqueuing the
 script for page ($hook_suffix) 'widgets.php' only.

 I manually enqueued the text-widgets.js script but got js error.

 Also, this issue appears on other widgets like video, image etc.

 Steps to replicate the issue:
 -> just copy 'admin/widgets.php' to 'admin/widgets-test.php' or any other
 page-slug and access it directly. Then try to add text-widget.

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


More information about the wp-trac mailing list