Opened 6 years ago
Last modified 6 years ago
#45218 new defect (bug)
On Custom Widget Page: Title and Content missing when Text Widget is added to Widget area
Reported by: | limvus | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.9.8 |
Component: | Widgets | Keywords: | reporter-feedback |
Focuses: | ui, administration | Cc: |
Description
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.
@limvus thanks for the ticket and welcome to trac!
I am having a bit of trouble understanding the issue. Would you be able to provide some code or screenshots that better demonstrate the issue? Also, does this issue still occur in the latest version of WordPress?
Based on the description, I feel like this may be less of a core bug and more of an issue with trying to customize the admin experience ( again, more clarification may be needed if I have misunderstood ) and I am leaning towards closing this as such.