Commit Graph

311 Commits

Author SHA1 Message Date
Sergey Biryukov cc8e05df39 Widgets: Allow for short-circuiting widget output in `the_widget()` using the `widget_display_callback` filter, for consistency with output via a registered sidebar.
Props MarcGuay, donmhico.
Fixes #34226.
Built from https://develop.svn.wordpress.org/trunk@45798


git-svn-id: http://core.svn.wordpress.org/trunk@45609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-14 23:03:55 +00:00
Sergey Biryukov 8e85299a00 General: First pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Props ianbelanger, tobifjellner, SergeyBiryukov.
See #47771.
Built from https://develop.svn.wordpress.org/trunk@45674


git-svn-id: http://core.svn.wordpress.org/trunk@45485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-25 22:45:57 +00:00
Gary Pendergast 2fe355cdd0 Code Modernisation: Introduce the spread operator in `widgets.php`.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props jrf.
See #47678.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-12 00:14:58 +00:00
Gary Pendergast abcbee954f Coding Standards: Fix instances of `WordPress.PHP.NoSilencedErrors.Discouraged`.
Noteable changes:
- The `magic_quotes_runtime` and `magic_quotes_sybase` settings were removed in PHP 5.4, so no longer need to be set.
- Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
- Quite a few functions would cause errors if `safe_mode` was set. This setting was removed in PHP 5.4.
- Only a handful of `header()` calls needed corresponding `headers_sent()` checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.

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


git-svn-id: http://core.svn.wordpress.org/trunk@45422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-09 05:45:58 +00:00
Gary Pendergast 4803fc405e Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-includes`.
See #47632.


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


git-svn-id: http://core.svn.wordpress.org/trunk@45401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-02 23:42:58 +00:00
John Blackbourn 557ef04409 Docs: Improve docs for variadic functions relating to widgets and their controls.
See #37402

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


git-svn-id: http://core.svn.wordpress.org/trunk@45260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 22:05:51 +00:00
Gary Pendergast 767fb99e94 Docs: Improve documentation of the ``$wp_registered_sidebars` global.
Props mukesh27.
Fixes #43448.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-14 23:01:49 +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
Felix Arntz dac5651f23 Widgets: Allow basic inline tags in `wp_sidebar_description()`.
The customizer has allowed HTML in sidebar descriptions since adding support for sidebars. This change ensures that basic HTML is also allowed for them in the widgets admin screen.

Fixes #42608.

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


git-svn-id: http://core.svn.wordpress.org/trunk@43104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-05-15 16:55:21 +00:00
Dominik Schilling 5c291d49de Pinking shears.
See #41057.
Built from https://develop.svn.wordpress.org/trunk@42843


git-svn-id: http://core.svn.wordpress.org/trunk@42673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-03-18 14:23:33 +00:00
Drew Jaynes 6e665d1f15 Docs: Link to the "Conditional Tags" article in the Theme Developer Handbook from the descriptions for a variety of core conditional tag functions.
These notations largely serve to direct consumers (of both the source and the parsed code reference) to extended information on individual and related conditional tags throughout WordPress. The changeset also standardizes corresponding DocBlock summaries to use third-person singular verbs.

Notations been added for the following functions:

* comments_open()
* email exists()
* has_excerpt()
* has_post_thumbnail()
* has_tag()
* in_category()
* in_the_loop()
* is_404()
* is_active_sidebar()
* is_active_widget()
* is_admin()
* is_admin_bar_showing()
* is_archive()
* is_attachment()
* is_author()
* is_blog_installed()
* is_category()
* is_comments_popup()
* is_date()
* is_day()
* is_dynamic_sidebar()
* is_feed()
* is_front_page()
* is_home()
* is_local_attachment()
* is_main_query
* is_month()
* is_multi_author
* is_new_day()
* is_page()
* is_page_template()
* is_paged()
* is_plugin_active()
* is_plugin_active_for_network()
* is_plugin_inactive()
* is_plugin_page()
* is_post_type_archive()
* is_preview()
* is_rtl()
* is_search()
* is_single()
* is_singular()
* is_sticky()
* is_tag()
* is_tax()
* is_taxonomy_hierarchical()
* is_time()
* is_trackback()
* is_user_logged_in()
* is_year()
* pings_open()
* post_type_exists()
* taxonomy_exists()
* term_exists()
* username exists()
* wp_attachment_is_image()
* wp_script_is()

Props janalwin.
Fixes #43254.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-02-13 16:54:31 +00:00
Konstantin Obenland 856e7917e8 Widgets: Always try restoring widget assignments
For code-historic reasons, restoring widget assignments would not be attempted if there were no sidebars to map.
Restoring previous assignments is something unrelated to sidebar mappings however, so now it will be attempted on every theme switch.

See #42719.

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


git-svn-id: http://core.svn.wordpress.org/trunk@42203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-07 02:20:52 +00:00
Konstantin Obenland ff25787995 Widgets: Don't try mapping empty sidebars.
Fixes a bug where the mapping logic would try mapping empty sidebars, resulting in PHP warnings.

Props ionvv, chetan200891 for initial patch.
Fixes #42603.


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


git-svn-id: http://core.svn.wordpress.org/trunk@42191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-04 20:12:48 +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 3aa0c23274 Docs: After [37329], update the documentation for `register_widget()` and `unregister_widget()`.
Both functions can accept a `WP_Widget` instance object instead of a `WP_Widget` subclass name, same as `WP_Widget_Factory::register()` and `::unregister()`.

Props behzod.
Fixes #42270.
Built from https://develop.svn.wordpress.org/trunk@41942


git-svn-id: http://core.svn.wordpress.org/trunk@41776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-19 13:51:50 +00:00
Konstantin Obenland 8911893672 Widgets: Update globals documentation.
It doesn't look like `wp_register_sidebar_widget()` ever used a global named `$wp_register_widget_defaults`. It does however make use of `$wp_registered_widget_controls` now.

See [8960], [30776].

Props upadalavipul.
Fixes #41592.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-09 16:35:47 +00:00
Konstantin Obenland 1e6810e433 Widgets: Revert format of `sidebars_widgets`.
Restores the data format of the `sidebars_widgets` theme mod to its pre [41555]
format. It can trigger PHP warnings after switching themes if that mod has not
been removed previously.

Fixes #39693.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-02 18:11:46 +00:00
Konstantin Obenland eea0e5f6f5 Widgets: Merge orphaned widgets on theme switch
Merges orphaned widgets into the inactive sidebar when switching themes.

Props bpayton.
See #39693.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 16:19:46 +00:00
Weston Ruter bb97df7b5f Widgets: Introduce Gallery widget for displaying image galleries.
* Galleries are managed in the widget in the same way they are managed in the post editor, both using the media manager.
* Gallery widget is merged from the Core Media Widgets v0.2.0 feature plugin and it extends `WP_Widget_Media` in the same way as is done for image, audio, and video widgets.
* Model syncing logic is updated to support booleans and arrays (of integers).
* Placeholder areas in media widgets are now clickable shortcuts for selecting media.
* Image widget placeholder is updated to match gallery widget where clicking preview is shortcut for editing media.

Props westonruter, joemcgill, timmydcrawford, m1tk00, obenland, melchoyce.
See #32417.
Fixes #41914.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-25 06:28:45 +00:00
Konstantin Obenland 27536e99c5 Widgets: Improved sidebar mapping on theme switch
Builds on efforts brought forward in #17979.

This will send sidebars through three levels of mapping:

1. If both themes have only one sidebar, that gets mapped.
2. If both themes have sidebars with the same slug, they get mapped.
3. Sidebars that (even partially) match slugs from a similar kind of sidebar will get mapped.

Finally, if the theme has previously been active and we have a record of its 
sidebar configuration then, any unmapped sidebar will be restored to its 
previous state.

Props westonruter, obenland, alexvorn2, timmydcrawford.
See #39693.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-21 18:46:46 +00:00
Konstantin Obenland a1688f0d2a Widgets: Improve _doing_it_wrong message.
Adds more context to help sending developers on the path to success.

Props ramiy.
Fixes 41743.

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


git-svn-id: http://core.svn.wordpress.org/trunk@41173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-06 21:32:43 +00:00
Konstantin Obenland 564e13cf30 Widgets: Add nudge for registered widgets
Informs developers that widgets need to be registered before they can be
displayed through `the_widget()`. Previously it would fail with an ambiguous
undefined index notice.

Props SeBsZ, mrasharirfan.
Fixes #41743.


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


git-svn-id: http://core.svn.wordpress.org/trunk@41158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-01 08:50:47 +00:00
Weston Ruter a46d94efeb Widgets: Rename "HTML Code" widget to "Custom HTML" widget.
Correspondingly renames files, ID base from `html_code` to `custom_html`, and the filter from `widget_html_code_content` to `widget_custom_html_content`.

See #40907.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-24 00:00:45 +00:00
Weston Ruter 38db73cff8 Widgets: Add widget dedicated for HTML Code, taking over this role of the Text widget.
Props westonruter, timmydcrawford.
See #40951, #35243.
Fixes #40907.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-06-09 23:54:42 +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 31d4d81039 Widgets: Introduce media widgets for images, audio, and video with extensible base for additional media widgets in the future.
The last time a new widget was introduced, Vuvuzelas were a thing, Angry Birds started taking over phones, and WordPress stopped shipping with Kubrick. Seven years and 17 releases without new widgets have been enough, time to spice up your sidebar!

Props westonruter, melchoyce, obenland, timmydcrawford, adamsilverstein, gonom9, wonderboymusic, Fab1en, DrewAPicture, sirbrillig, joen, matias, samikeijonen, afercia, celloexpressions, designsimply, michelleweber, ranh, kjellr, karmatosed.
Fixes #32417, #39993, #39994, #39995.

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


git-svn-id: http://core.svn.wordpress.org/trunk@40501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-05-11 21:11:44 +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
Sergey Biryukov a1319d63a0 Widgets: In `unregister_sidebar()`, rename the `$name` parameter to `$sidebar_id` for consistency with `is_registered_sidebar()`.
Also correct the parameter type in `@param` entry.

Props Soean, tmatsuur.
Fixes #35147.
Built from https://develop.svn.wordpress.org/trunk@39892


git-svn-id: http://core.svn.wordpress.org/trunk@39829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-12 06:38:54 +00:00
Sergey Biryukov 518fc0a05b I18N: Merge two 'RSS Error:' strings.
Props ramiy.
Fixes #38861.
Built from https://develop.svn.wordpress.org/trunk@39311


git-svn-id: http://core.svn.wordpress.org/trunk@39251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-19 01:56:31 +00:00
Drew Jaynes 9193013158 Docs: Apply inline `@see` tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

Fixes #36921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:02:28 +00:00
Drew Jaynes 9cb5247392 Docs: Standardize filter docs in remaining wp-includes/* files to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:50:28 +00:00
Drew Jaynes fe3b007fdd Docs: Remove inline `@see` tags from function, class, and method references in inline docs.
Known functions, classes, and methods are now auto-linked in Code Reference pages following #meta1483.

Note: Hook references are still linked via inline `@see` tags due to the unlikelihood of reliably matching for known hooks based on a RegEx pattern.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-02 04:00:28 +00:00
Dominik Schilling e5ea82d81a Spelling: Standardize on "front end"/"back end" (noun) and "front-end"/"back-end" (adjective).
Props obrienlabs, thewanderingbrit.
Fixes #34887.
Built from https://develop.svn.wordpress.org/trunk@36709


git-svn-id: http://core.svn.wordpress.org/trunk@36676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-25 12:53:27 +00:00
Sergey Biryukov 54b8932923 Widgets: Avoid a PHP notice in `is_dynamic_sidebar()` is a sidebar is registered but does not yet have an index in the `sidebars_widgets` option.
Props dlh.
Fixes #35928.
Built from https://develop.svn.wordpress.org/trunk@36667


git-svn-id: http://core.svn.wordpress.org/trunk@36634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 01:37:26 +00:00
Sergey Biryukov 7b3b8f6fd4 Widgets: Revert [34465], as it introduced a regression, making the `$index` argument of `dynamic_sidebar()` case-sensitive.
Fixes #34995 for trunk. See #23423.
Built from https://develop.svn.wordpress.org/trunk@36130


git-svn-id: http://core.svn.wordpress.org/trunk@36096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-31 03:13:26 +00:00
Drew Jaynes 76cc768e90 Docs: Add a better summary, missing `@since` version, parameter and return descriptions to the DocBlock for `_get_widget_id_base()`.
Introduced in [11484].

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 17:27:28 +00:00
Drew Jaynes 94575687b9 Docs: Add a missing summary, `@since` version, and parameter descriptions in the DocBlock for `_register_widget_form_callback()`.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 17:23:26 +00:00
Drew Jaynes c13824b1c0 Docs: Fix syntax for marking parameters optional in the DocBlock for `is_active_widget()`.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 17:19:26 +00:00
Drew Jaynes 9de8a1466a Docs: Add a missing summary, `@since` version, and parameter descriptions to the DocBlock for `_register_widget_update_callback()`.
Introduced in [10798].

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-17 17:16:26 +00:00
Drew Jaynes 0fcf24a38e Docs: Document the optional `$options` parameter for `wp_register_widget_control()` as a hash notation.
Props stephanethomas.
Fixes #34855.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-11 15:24:28 +00:00
Sergey Biryukov bc1e479fd0 After [35718], update the location of some files in `This filter is documented in` docs.
Partially reverts [33954].

Fixes #33413.
Built from https://develop.svn.wordpress.org/trunk@35725


git-svn-id: http://core.svn.wordpress.org/trunk@35689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-22 03:51:28 +00:00
Andrew Nacin 1579e45d41 Simplify the include graph after work to split out classes.
see #33413. More details there.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-20 07:24:30 +00:00
Drew Jaynes 31f52091ec Docs: Clarify the file header summary for wp-includes/widgets.php, the top-level file for the core Widgets API.
Also fixes some minor grammar issues in the file description.

See #33413. See #33701.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-03 03:14:20 +00:00
Drew Jaynes fb75e4b938 Docs: Add inline-docblocks for the `require_once()` calls that now bring in the `WP_Widget` and `WP_Widget_Factory` classes, as well as general core widgets functionality, as of [33746].
See [33746]. See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 08:01:20 +00:00
Scott Taylor c3565b2cba Widgets: move classes into their own files, `widgets.php` loads the new files, so this is 100% BC if someone is loading `widgets.php` directly. New files created using `svn cp`.
Creates: 
`class-wp-widget.php` 
`class-wp-widget-factory.php` 
`widget-functions.php` 

`widgets.php` contains only top-level code. Class files only contain classes. Functions file only contains functions.

See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 02:40:23 +00:00
Weston Ruter cb2879b9d4 Widgets: Switch back to using `array_key_exists()` instead of `isset()` for widget instance existence check.
Reverts unnecessary change in [32602] since `array_key_exists()` does actually work with `ArrayIterator` objects.

See #32474.
Fixes #33442.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-21 18:09:25 +00:00
Aaron Jorbin 1525010f74 Deprecate php4 style constructors
PHP7 is deprecating PHP4 style constructors, so we need to modify our code to have _construct methods that fire before the named PHP4 style constructors.  The PHP4 style constructors will call the PHP5 style constructor in case it is being called directly (usually via parent::METHOD).

This modifies external libraries to add PHP5 style constructors, but doesn't add a notice for when they are used.  In WordPress core code, PHP4 style constructors are being given a call to _deprecated_constructor. To the PHP4 style constructor I say "I know that I can't take no more | It ain't no lie | I wanna see you out that door | Baby, bye, bye, bye..."

Upstream: https://wiki.php.net/rfc/remove_php4_constructors

Props jdgrimes, netweb, jorbin
See #31982


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


git-svn-id: http://core.svn.wordpress.org/trunk@32961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-28 15:27:24 +00:00
Scott Taylor bece996d45 Add missing doc blocks to `widgets.php`.
Cleanup `@return` values.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 16:20:25 +00:00
Weston Ruter 7792b5c942 Add support for `WP_Widget::get_settings()` returning `ArrayIterator`/`ArrayObject` instances.
Plugins can use `pre_option_widget_{$id_base}` filters to return `ArrayIterator`/`ArrayObject` instances instead of primitive arrays. This makes possible for widget instance data to be drawn from somewhere else than `wp_options`, such as a custom post type.

Add unit tests for widgets.

Fixes #32474.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-26 16:51:27 +00:00
Scott Taylor af7a017f46 When calling `unset()`, it is unnecessary to immediately precede it with a call to `isset()`.
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-22 05:47:25 +00:00