Scott Taylor
65c8adc252
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@35106 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-13 01:48:41 +00:00
Drew Jaynes
72c81e01d4
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@35104 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-13 01:44:44 +00:00
Scott Taylor
3616fe5939
Widgets: add a function, is_registered_sidebar() - helps us avoid touching the $wp_registered_sidebars global.
...
Props GaryJ, wonderboymusic.
Fixes #24878 .
git-svn-id: https://develop.svn.wordpress.org/trunk@35102 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-13 01:32:27 +00:00
John Blackbourn
1bb2876fe6
callback is not a valid type in PHP, PSR-5, or phpDocumentor. callable should be used instead.
...
Fixes #34032
git-svn-id: https://develop.svn.wordpress.org/trunk@34566 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-25 23:57:46 +00:00
Scott Taylor
c1c93f1e95
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34465 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-24 00:29:54 +00:00
Drew Jaynes
5e875e78f7
Docs: The Widget API is singular.
...
See #33701 .
git-svn-id: https://develop.svn.wordpress.org/trunk@34392 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-22 12:27:33 +00:00
Scott Taylor
a4a469d887
After [33843], update the location of some files in This filter is documented in docs
...
Props dimadin.
See #33413 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33954 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-08 22:16:57 +00:00
Drew Jaynes
50d0b587f6
Docs: Clarify the file header summary for widget-functions.php, introduced in [33746].
...
See #33413 . See #33701 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33871 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-03 02:57:10 +00:00
Scott Taylor
1e084b6eaa
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33843 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-01 13:49:00 +00:00
Drew Jaynes
fc691e0457
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33757 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 07:56:30 +00:00
Scott Taylor
6c71ee8d84
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@33746 602fd350-edb4-49c9-b593-d223f7449a82
2015-08-26 02:39:50 +00:00