Commit Graph

201 Commits

Author SHA1 Message Date
audrasjb
99bac7e17c Docs: Replace "Current theme" with "Active theme" in various DocBlocks.
This change replaces "Current theme" with "Active theme" in various DocBlocks for better consistency with user-facing strings.

Follow-up to [52580].

Props Presskopp, audrasjb, costdev.
Fixes #54831.
See #54770.

Built from https://develop.svn.wordpress.org/trunk@52610


git-svn-id: http://core.svn.wordpress.org/trunk@52198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 23:53:05 +00:00
joedolson
fffde30995 Widgets: Add filter to disable RSS widget icon.
Add a filter that disables output of the icon on RSS feed widgets. Improves accessibility by providing a path to prevent duplicate or invisible links.

Props sabernhardt, Boniu91.
Fixes #52224.
Built from https://develop.svn.wordpress.org/trunk@52031


git-svn-id: http://core.svn.wordpress.org/trunk@51623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:04:56 +00:00
joedolson
a3a61c5a3e General: Remove role="navigation" from nav elements.
Role="navigation" was required for assistive technology to recognize HTML5 element's native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don't have native role.

Props costdev, mukesh27.
Fixes #54054.
Built from https://develop.svn.wordpress.org/trunk@51967


git-svn-id: http://core.svn.wordpress.org/trunk@51556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 21:47:13 +00:00
John Blackbourn
6e1cc35a98 Docs: Miscellaneous docblock corrections and improvements.
See #52217, #53399

Built from https://develop.svn.wordpress.org/trunk@51851


git-svn-id: http://core.svn.wordpress.org/trunk@51450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 21:23:00 +00:00
John Blackbourn
07f3c35467 General: Fix code quality issues which were identified by static analysis.
This fixes minor issues that could cause PHP notices under the right conditions, and fixes some general incorrectness.

Props jrf, hellofromTonya for review

See #52217

Built from https://develop.svn.wordpress.org/trunk@51850


git-svn-id: http://core.svn.wordpress.org/trunk@51449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 21:01:00 +00:00
Sergey Biryukov
a13f7b31cd I18N: Add a translator comment to clarify the "Block HTML" string in the Block widget settings form.
The string refers to HTML code of the block, not an option that blocks HTML.

Follow-up to [50995].

Props Amieiro, NekoJonez, knutsp, johnbillion, namith.jawahar, SergeyBiryukov.
Fixes #54110.
Built from https://develop.svn.wordpress.org/trunk@51814


git-svn-id: http://core.svn.wordpress.org/trunk@51421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 11:49:01 +00:00
hellofromTonya
68e0c5e520 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Widget::update().
In each child class, renames the parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds @since to clearly specify why the change happened.

Replaces the original with the variable name with within each method.
Why? The new name is more specific and descriptive, which improves readability.

Follow-up to [10782], [25090], [26556], [40640].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51789


git-svn-id: http://core.svn.wordpress.org/trunk@51396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 20:13:57 +00:00
Peter Wilson
34119e2c95 Widgets: Validate HTML before saving block widgets.
Props talldanwp, noisysocks, kevin940726, peterwilsoncc.

Built from https://develop.svn.wordpress.org/trunk@51414


git-svn-id: http://core.svn.wordpress.org/trunk@51025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 05:59:01 +00:00
Sergey Biryukov
6311baa859 Docs: Update documentation for WP_Widget_Block per the documentation standards.
Remove unused `$post` global reference.

Follow-up to [50995], [51058], [51063], [51221].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51249


git-svn-id: http://core.svn.wordpress.org/trunk@50858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 08:35:57 +00:00
desrosj
fccc020d29 Docs: Various docblock corrections for code added in 5.8.
Props johnbillion.
See #53461.
Built from https://develop.svn.wordpress.org/trunk@51221


git-svn-id: http://core.svn.wordpress.org/trunk@50830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 19:05:57 +00:00
whyisjake
2e36162a20 Widgets: Don't decode HTML entities ahead of the widget constructor.
This reverts the changes from [51114]. 

See #53138.

Unprops whyisjake. 

Built from https://develop.svn.wordpress.org/trunk@51127


git-svn-id: http://core.svn.wordpress.org/trunk@50736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:40:00 +00:00
whyisjake
81c4c4138c Widgets: Ensure that HTML entities are converted in widget descriptions.
Fixes #53138.

Props justinahinon, audrasjb.

Built from https://develop.svn.wordpress.org/trunk@51114


git-svn-id: http://core.svn.wordpress.org/trunk@50723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:17:57 +00:00
Aaron Jorbin
e2104af75e Widgets: Prevent infinite loop in PHP8+ if the URL for the widget instance is incorrectly defined
This checks to make sure $link isn't empty before attempting to manipulate it.  A simple test to demonstrate this can be seen at https://3v4l.org/PgSZg. Unit tests for both what already works and what is fixed by this change.

Props hellofromTonya, dd32, peterwilsoncc.
Fixes #53278.


Built from https://develop.svn.wordpress.org/trunk@51107


git-svn-id: http://core.svn.wordpress.org/trunk@50716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 19:35:57 +00:00
Sergey Biryukov
fde119d446 Docs: Correct type for the $widget parameter of the widget_block_content filter.
Follow-up to [51058].

See #51566.
Built from https://develop.svn.wordpress.org/trunk@51063


git-svn-id: http://core.svn.wordpress.org/trunk@50672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 10:57:57 +00:00
noisysocks
38cea1e659 Widget block: Add widget_block_content filter
Adds a new 'widget_block_content' filter to the widget block and hooks
`run_shortcode`, `autoembed`, `do_blocks`, and `do_shortcode` into it by
default. This is simlar to `widget_text_content.`

Fixes #51566.
Props talldanwp.

Built from https://develop.svn.wordpress.org/trunk@51058


git-svn-id: http://core.svn.wordpress.org/trunk@50667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:18:57 +00:00
desrosj
836b5ad7c7 Coding Standards: Apply some minor coding standards adjustments.
Follow up to [50977], [50987], and [50995].

See #41683, #53156, #53175.
Built from https://develop.svn.wordpress.org/trunk@51007


git-svn-id: http://core.svn.wordpress.org/trunk@50616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 17:43:57 +00:00
noisysocks
1314542c50 REST API: Add widget endpoints
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs, spacedmonkey, zieladam, jorgefilipecosta, youknowriad, kevin940726.

Built from https://develop.svn.wordpress.org/trunk@50995


git-svn-id: http://core.svn.wordpress.org/trunk@50604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:27:57 +00:00
noisysocks
ed195fbd89 REST API: Revert widget endpoints
Reverts [50993] as it has missing props.

Reverts [50993].
See #41683.

Built from https://develop.svn.wordpress.org/trunk@50994


git-svn-id: http://core.svn.wordpress.org/trunk@50603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:22:56 +00:00
noisysocks
2a4e1e0c04 REST API: Add widget endpoints
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs.

Built from https://develop.svn.wordpress.org/trunk@50993


git-svn-id: http://core.svn.wordpress.org/trunk@50602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 07:52:55 +00:00
davidbaumwald
589e89231a Coding Standards: Update $out in WP_Widget_Pages with a more meaningful name.
Rename an `$out` variable to `$output` for consistency with other widget classes..

Props mukesh27.
Fixes #53059.
Built from https://develop.svn.wordpress.org/trunk@50797


git-svn-id: http://core.svn.wordpress.org/trunk@50406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-28 20:55:03 +00:00
Sergey Biryukov
d3d78e755b Coding Standards: Add a space before / character in some self-closing HTML tags.
While this has no effect on the code, it fixes a minor inconsistency with the rest of core.

Props laxman-prajapati.
Fixes #52870.
Built from https://develop.svn.wordpress.org/trunk@50556


git-svn-id: http://core.svn.wordpress.org/trunk@50169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-20 18:30:08 +00:00
John Blackbourn
6f3a940e64 Plugins: Replace usage of $this in action and filter parameter docblocks with more appropriate variable names.
See #51800, #52217

Fixes #52243

Built from https://develop.svn.wordpress.org/trunk@49946


git-svn-id: http://core.svn.wordpress.org/trunk@49645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-08 14:30:14 +00:00
Sergey Biryukov
651f426b3a General: Remove noreferrer from wp_targeted_link_rel() and other uses.
When `noopener noreferrer` was originally added in #37941 and related tickets, the `noreferrer` bit was specifically included due to Firefox not supporting `noopener` at the time.

Since `noopener` has been supported by all major browsers for a while, it should now be safe to remove the `noreferrer` attribute from core.

Props Mista-Flo, audrasjb, joostdevalk, jonoaldersonwp, peterwilsoncc, elgameel.
Fixes #49558.
Built from https://develop.svn.wordpress.org/trunk@49215


git-svn-id: http://core.svn.wordpress.org/trunk@48977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 23:39:04 +00:00
Sergey Biryukov
0e3147c40e Coding Standards: Replace alias PHP functions with the canonical names.
Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces all uses of the following:
* `join()` with `implode()`
* `sizeof()` with `count()`
* `is_writeable()` with `is_writable()`
* `doubleval()` with a `(float)` cast

In part, this is a follow-up to #47746.

Props jrf.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@49193


git-svn-id: http://core.svn.wordpress.org/trunk@48955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 17:27:06 +00:00
Sergey Biryukov
6dba11fb82 Accessibility: Widgets: Conditionally wrap the tag cloud widget in a <nav> element.
If the theme declares support for the `html5` feature `navigation-widgets`, the tag cloud widget is now wrapped in a `<nav>` element to improve semantics and accessibility.

The `<nav>` elements are native landmark regions, which helps assistive technology users to navigate through them.

Follow-up to [48349] for other widgets.

Props audrasjb, justinahinon, ravipatel.
Fixes #51455. See #48170.
Built from https://develop.svn.wordpress.org/trunk@49177


git-svn-id: http://core.svn.wordpress.org/trunk@48939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 18:32:06 +00:00
John Blackbourn
905460bd5e Docs: Standardise the type name for booleans and integers.
This brings these docs inline with the documentation standards.

Props ravipatel, justinahinon

Fixes #51426

Built from https://develop.svn.wordpress.org/trunk@49120


git-svn-id: http://core.svn.wordpress.org/trunk@48882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 20:02:05 +00:00
Sergey Biryukov
897f004a9c General: Replace older-style PHP type conversion functions with type casts.
This improves performance, readability, and consistency throughout core.

* `intval()` → `(int)`
* `strval()` → `(string)`
* `floatval()` → `(float)`

Props ayeshrajans.
Fixes #42918.
Built from https://develop.svn.wordpress.org/trunk@49108


git-svn-id: http://core.svn.wordpress.org/trunk@48870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 21:15:13 +00:00
Sergey Biryukov
1f85e7484f Docs: Consistently use third-person singular verbs for various filter descriptions, per the documentation standards.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48782


git-svn-id: http://core.svn.wordpress.org/trunk@48544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-11 00:34:08 +00:00
Sergey Biryukov
07b4429203 Widgets: Use correct escaping function in WP_Widget_Archives::widget().
Props chintan1896, afercia.
See #50826.
Built from https://develop.svn.wordpress.org/trunk@48699


git-svn-id: http://core.svn.wordpress.org/trunk@48461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 13:15:05 +00:00
John Blackbourn
0bf9b04c53 Docs: Various formatting improvements to inline docblocks.
See #49572
Built from https://develop.svn.wordpress.org/trunk@48574


git-svn-id: http://core.svn.wordpress.org/trunk@48336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-23 00:52:05 +00:00
Sergey Biryukov
19779e6302 Widgets: Make sure image widgets with custom image size render captions.
Props kasparsd, JavierCasares, audrasjb.
Fixes #50160.
Built from https://develop.svn.wordpress.org/trunk@48557


git-svn-id: http://core.svn.wordpress.org/trunk@48319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-21 23:14:06 +00:00
Sergey Biryukov
c4a2b9a9e4 Widgets: Adjust formatting for displaying the closing </nav> tag in widgets for consistency with the opening tag.
Follow-up to [48349].

See #48170.
Built from https://develop.svn.wordpress.org/trunk@48410


git-svn-id: http://core.svn.wordpress.org/trunk@48179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-08 13:44:04 +00:00
Sergey Biryukov
6fc76c162d Widgets: Correct the logic for displaying the after_widget parameter of the Archives widget.
Follow-up to [48349].

Props mukesh27, joyously.
Fixes #50609.
Built from https://develop.svn.wordpress.org/trunk@48409


git-svn-id: http://core.svn.wordpress.org/trunk@48178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-08 13:28:03 +00:00
Andrea Fercia
a5721358e1 Docs: Reference the documentation of the new navigation_widgets_format filter instead of repeating it.
Follow-up to [48349].

Props johnbillion.
Fixes #48170.

Built from https://develop.svn.wordpress.org/trunk@48388


git-svn-id: http://core.svn.wordpress.org/trunk@48157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-07 17:06:04 +00:00
Andrea Fercia
04921ffd45 Accessibility: Widgets: Add theme support to make widgets output list of links wrapped within a <nav> element.
Widgets that output list of links can now be wrapped within `<nav>` elements to improve semantics and accessibility.

The `<nav>` elements are also native landmark regions, which helps assistive technology users to navigate through them. Themes can opt-in to this new behavior by declaring support for the new `html5` feature `navigation-widgets`.

Props joedolson, simonjanin, audrasjb, afercia.
Fixes #48170.

Built from https://develop.svn.wordpress.org/trunk@48349


git-svn-id: http://core.svn.wordpress.org/trunk@48118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-06 20:44:02 +00:00
Sergey Biryukov
19bca10d79 Coding Standards: Replace echo sprintf() with printf().
See #49542.
Built from https://develop.svn.wordpress.org/trunk@48111


git-svn-id: http://core.svn.wordpress.org/trunk@47880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 13:18:11 +00:00
Sergey Biryukov
b16368c268 Docs: Remove @staticvar tags from core.
The tag was supported in phpDocumentor 1.x, but is no longer supported in 2.x and 3.x.

Usage of static variables is considered an internal implementation detail and has no information value for someone reading the docs.

Props alishanvr, jrf.
Fixes #50426.
Built from https://develop.svn.wordpress.org/trunk@48109


git-svn-id: http://core.svn.wordpress.org/trunk@47878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:40:12 +00:00
Sergey Biryukov
43a6aff0d4 Coding Standards: Use strict comparison in wp-includes/widgets/class-wp-widget-rss.php.
Props mukesh27.
Fixes #50125.
Built from https://develop.svn.wordpress.org/trunk@47774


git-svn-id: http://core.svn.wordpress.org/trunk@47550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-08 08:36:18 +00:00
Sergey Biryukov
fc7561ce11 Coding Standards: Format the markup of widget forms in a more consistent manner.
See #49542.
Built from https://develop.svn.wordpress.org/trunk@47593


git-svn-id: http://core.svn.wordpress.org/trunk@47368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-17 09:38:07 +00:00
Sergey Biryukov
38676936ba Coding Standards: Use strict type check for in_array() and array_search() where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
Sergey Biryukov
8b0a0c44aa Widgets: Create a unique HTML ID for the <ul> element of Recent Comments widget if more than one instance is displayed on the page.
Props peterwilsoncc, audrasjb, birgire, justinahinon, mbrailer, desrosj.
Fixes #46747.
Built from https://develop.svn.wordpress.org/trunk@47371


git-svn-id: http://core.svn.wordpress.org/trunk@47158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-25 19:29:06 +00:00
desrosj
4cc82e180e Widgets: Revert [47307].
Even though the source URL for an attachment is stored in a variable, attachments should still be passed through the `wp_video_shortcode()` function.

Unprops desrosj, spacedmonkey.
See #46718.
Built from https://develop.svn.wordpress.org/trunk@47308


git-svn-id: http://core.svn.wordpress.org/trunk@47108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-18 18:19:06 +00:00
desrosj
520fe14f79 Widgets: Remove unnecessary redundant conditional.
Props spacedmonkey.
Fixes #46718.
Built from https://develop.svn.wordpress.org/trunk@47307


git-svn-id: http://core.svn.wordpress.org/trunk@47107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-18 17:52:06 +00:00
Sergey Biryukov
6b2c63031c Coding Standards: Rename $d parameter in various date/time functions to $format for clarity.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47287


git-svn-id: http://core.svn.wordpress.org/trunk@47087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-14 00:07:07 +00:00
Sergey Biryukov
47ed56f38f Code Modernization: Replace dirname( __FILE__ ) calls with __DIR__ magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.
Built from https://develop.svn.wordpress.org/trunk@47198


git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 06:33:11 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
a94ed9baf3 Docs: Remove @return void from widget DocBlocks.
Per the documentation standards, it should not be used outside of the default bundled themes.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47055


git-svn-id: http://core.svn.wordpress.org/trunk@46855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-10 00:30:05 +00:00
John Blackbourn
aa1fdcbd52 Docs: Correct various docblocks documentation.
See #48303
Built from https://develop.svn.wordpress.org/trunk@46821


git-svn-id: http://core.svn.wordpress.org/trunk@46621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-06 22:23:04 +00:00
John Blackbourn
f243cd573c Docs: Correct invalid hook docblock placement.
See #48303

Built from https://develop.svn.wordpress.org/trunk@46604


git-svn-id: http://core.svn.wordpress.org/trunk@46401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-27 19:35:01 +00:00
Sergey Biryukov
406dc81ebc Coding Standards: Fix WPCS issues in WP_Widget_Links and WP_Widget_Pages.
Props itowhid06.
Fixes #48228.
Built from https://develop.svn.wordpress.org/trunk@46415


git-svn-id: http://core.svn.wordpress.org/trunk@46213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-06 15:28:03 +00:00