Commit Graph

21 Commits

Author SHA1 Message Date
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
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
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
Gary Pendergast
56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


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


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Sergey Biryukov
46ff957961 Widgets: Move empty title checks out of the apply_filters( 'widget_title' ) calls for clarity.
See #42226.
Built from https://develop.svn.wordpress.org/trunk@41867


git-svn-id: http://core.svn.wordpress.org/trunk@41701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-15 21:43:47 +00:00
Sergey Biryukov
253541556e Widgets: Pass $instance to widget argument filters:
* `widget_archives_dropdown_args`
* `widget_archives_args`
* `widget_categories_dropdown_args`
* `widget_categories_args`
* `widget_meta_poweredby`
* `widget_pages_args`
* `widget_comments_args`
* `widget_posts_args`
* `widget_tag_cloud_args`

See [33971] for `widget_links_args` and [34662] for `widget_nav_menu_args`.

Props Takahashi_Fumiki.
Fixes #38017.
Built from https://develop.svn.wordpress.org/trunk@41685


git-svn-id: http://core.svn.wordpress.org/trunk@41519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 22:02:47 +00:00
Drew Jaynes
0860bb2771 Docs: Remove @access notations from method DocBlocks in wp-includes/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:41:44 +00:00
Andrea Fercia
bdad500af7 Widgets: Remove the title attributes used in the Tag cloud widget.
- improves accessibility using an aria-label attribute to match the information conveyed visually with the one exposed to assistive technologies
- adds an option in the widget to display the item counts, consistently with what other widgets already do (Archives, Categories)

Props adamsoucie, emirpprime, Samantha Miller., MikeLittle, rianrietveld, sami.keijonen, adamsilverstein, westonruter, afercia.
See #24766.
Fixes #35566.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-22 20:24:41 +00:00
Weston Ruter
123158e7d8 Widgets: Revert [40251] pending more accessible solution for showing default widget titles rather than using placeholders.
See #39909.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-19 20:45:40 +00:00
Weston Ruter
d7cb2f7706 Customize: Show title input placeholders for widgets that have default titles when rendered.
Fixes #39909.
Props bor0, dlh, westonruter.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 18:25:44 +00:00
Drew Jaynes
3a02481d9e Docs: Fix an incorrect pseudo-parameter referenced in the hook doc for the widget_tag_cloud_args filter.
Props backermann.
Fixes #37654.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 06:40:49 +00:00
Drew Jaynes
6b8248f3f7 Docs: Standardize hook docs in wp-includes/widgets/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:06:28 +00:00
Weston Ruter
f3f84d2f21 Customize: Require opt-in for selective refresh of widgets.
* Introduces `customize-selective-refresh-widgets` theme support feature and adds to themes.
* Introduces `customize_selective_refresh` arg for `WP_Widget::$widget_options` and adds to all core widgets.
* Remove `selective_refresh` from being a component that can be removed via `customize_loaded_components` filter.
* Add `WP_Customize_Widgets::get_selective_refreshable_widgets()` and `WP_Customize_Widgets::is_widget_selective_refreshable()`.
* Fix default `selector` for `Partial` instances.
* Implement and improve Masronry sidebar refresh logic in Twenty Thirteen and Twenty Fourteen, including preservation of initial widget position after refresh.
* Re-initialize ME.js when refreshing `Twenty_Fourteen_Ephemera_Widget`.

See #27355.
Fixes #35855.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-21 21:59:29 +00:00
Weston Ruter
aa9ef96a52 Customize: Prevent dropping backslashes from input on general settings and settings for nav menus and some widgets.
Ensures that intentional backslashes (e.g. "\o/") can be used in:

* Site title
* Site description
* Nav menu name
* Custom Menu widget title
* Tag Cloud widget title
* Text widget body if can't `unfiltered_html`

The latter three are also fixed on the widgets admin page.

Fixes #35898.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-23 01:02:26 +00:00
Dominik Schilling
5e0dac0f8f Widgets: Fix typo in WP_Widget_Tag_Cloud::form().
Props skithund.
Fixes #34623.
Built from https://develop.svn.wordpress.org/trunk@35576


git-svn-id: http://core.svn.wordpress.org/trunk@35540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-08 20:35:27 +00:00
Drew Jaynes
08277293e5 Docs: Improve the documentation for the __construct(), widget(), update(), and form() methods in WP_Widget_Tag_Cloud.
Props leemon.
Fixes #34026. See #34013.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-27 00:32:24 +00:00
Drew Jaynes
12196adb29 Docs: Add a file header to wp-includes/widgets/class-wp-widget-tag-cloud.php, introduced in [33746].
Also clarifies the class DocBlock summary and tags for `WP_Widget_Tag_Cloud`.

See #33413. See #33701.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 15:02:26 +00:00
Scott Taylor
a2f15ca7cd Widgets: don't show a dropdown if there is only 1 taxonomy or zero taxonomies available to the Tag Cloud widget form. Don't output the widget if there are no terms in the selected taxonomy.
Props GautamGupta, wonderboymusic.
Fixes #16125.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-17 22:11:24 +00:00
Scott Taylor
c1bb5b5ce3 After [33843], update the location of some files in This filter is documented in docs
Props dimadin.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-08 22:17:26 +00:00
Scott Taylor
9b8169bd30 Move widget classes to their own files in wp-includes/widgets:
* `default-widgets.php` now requires all of the individual classes
* Move the functions scattered about this file to `widget-functions.php`, which loads before `default-widgets.php`, which only conditionally loads anyway in `wp_maybe_load_widgets()`, which is hooked on `plugins_loaded` 

See #33413, #23012.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-01 13:49:21 +00:00