wordpress-develop/tests
Sergey Biryukov c4fd562663 Widgets: Make sure WP_Widget constructor creates a correct id_base value for a namespaced widget class.
The `id_base` value is used for the widget's `id` and `class` attributes and also for the option name which stores the widget settings (unless the widget specifies a custom `option_name` value).

With this change, any backslashes in the `id_base` for a namespaced widget class are converted to hyphens, making it easier to style the output or target the widget with JavaScript.

This also avoids a `preg_match(): Compilation failed` PHP warning from `next_widget_id_number()` on the Widgets screen, previously caused by unescaped backslashes.

Props Mte90, hermpheus, rogerlos, welcher, SergeyBiryukov.
Fixes #44098.

git-svn-id: https://develop.svn.wordpress.org/trunk@50953 602fd350-edb4-49c9-b593-d223f7449a82
2021-05-23 08:50:44 +00:00
..
e2e Build/Test Tools: Remove explicit puppeteer dependency. 2021-03-29 18:05:47 +00:00
gutenberg Editor: Update @wordpress npm packages 2021-03-05 04:08:33 +00:00
phpunit Widgets: Make sure WP_Widget constructor creates a correct id_base value for a namespaced widget class. 2021-05-23 08:50:44 +00:00
qunit Editor: Enqueue script and style assets only for blocks present on the page 2021-05-11 09:41:48 +00:00