• 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.

Viewing 1 replies (of 1 total)
  • Hi limvus,

    The widgets.php file is used purely to manage widgets via WP Admin. Other widget-related functions are used to output your websites within your theme.

    The WordPress Handbook has a great section on widgets which I’d recommend reviewing, before you debug further.

Viewing 1 replies (of 1 total)
  • The topic ‘On Custom Widget Page: Title and Content missing when Text Widget is added to Wi’ is closed to new replies.