Scott Taylor
05cd8a447e
Widgets: When using `the_widget()`, the `$before_widget` argument only receives the widget class if using the default sidebar arguments. Run `sprintf` after parsing the args to fix this.
...
Adds unit test.
Props coffee2code.
Fixes #19450 .
Built from https://develop.svn.wordpress.org/trunk@35106
git-svn-id: http://core.svn.wordpress.org/trunk@35071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 01:49:48 +00:00
Drew Jaynes
649382a7f1
Widgets: Rename the `$name` parameter in `is_registered_sidebar()` to `$sidebar_id` and adjust the accepted types to `string|int` as sidebar IDs can be numeric.
...
See #24878 .
Built from https://develop.svn.wordpress.org/trunk@35104
git-svn-id: http://core.svn.wordpress.org/trunk@35069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 01:45:25 +00:00
Scott Taylor
aa92c9555a
Widgets: add a function, `is_registered_sidebar()` - helps us avoid touching the `$wp_registered_sidebars` global.
...
Props GaryJ, wonderboymusic.
Fixes #24878 .
Built from https://develop.svn.wordpress.org/trunk@35102
git-svn-id: http://core.svn.wordpress.org/trunk@35067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 01:33:25 +00:00
John Blackbourn
aa35e473f7
`callback` is not a valid type in PHP, PSR-5, or phpDocumentor. `callable` should be used instead.
...
Fixes #34032
Built from https://develop.svn.wordpress.org/trunk@34566
git-svn-id: http://core.svn.wordpress.org/trunk@34530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 23:58:25 +00:00
Scott Taylor
627e7a56d3
Widgets: when passing a string arg value to `dynamic_sidebar()`, don't reset `$index` when the arg's sanitized value matches the sanitized name of a sidebar.
...
Adds unit test.
Props tyxla, fjarrett.
Fixes #23423 .
Built from https://develop.svn.wordpress.org/trunk@34465
git-svn-id: http://core.svn.wordpress.org/trunk@34429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 00:30:24 +00:00
Drew Jaynes
783876bd1a
Docs: The Widget API is singular.
...
See #33701 .
Built from https://develop.svn.wordpress.org/trunk@34392
git-svn-id: http://core.svn.wordpress.org/trunk@34356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-22 12:28:27 +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
Drew Jaynes
0ce0241740
Docs: Clarify the file header summary for widget-functions.php, introduced in [33746].
...
See #33413 . See #33701 .
Built from https://develop.svn.wordpress.org/trunk@33871
git-svn-id: http://core.svn.wordpress.org/trunk@33839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-03 02:58:20 +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
Drew Jaynes
f21cb339db
Docs: Add a file header description and `@since` version to wp-includes/widget-functions.php, introduced in [33746].
...
Also adds sub-section headers per the inline documentation standards for syntax.
See [33746]. See #33413 .
Built from https://develop.svn.wordpress.org/trunk@33757
git-svn-id: http://core.svn.wordpress.org/trunk@33725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-26 07:57: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