Widgets: Introduce register_sidebar_defaults filter for default arguments in register_sidebar().

Props patilvikasj, powerbuoy.
Fixes #48033.
Built from https://develop.svn.wordpress.org/trunk@46147


git-svn-id: http://core.svn.wordpress.org/trunk@45959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-16 09:13:54 +00:00
parent f3f1d530f4
commit 1060f7e167
2 changed files with 11 additions and 2 deletions

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46146';
$wp_version = '5.3-alpha-46147';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -263,7 +263,16 @@ function register_sidebar( $args = array() ) {
'after_title' => "</h2>\n",
);
$sidebar = wp_parse_args( $args, $defaults );
/**
* Filters the sidebar default arguments.
*
* @since 5.3.0
*
* @see register_sidebar()
*
* @param array $defaults The default sidebar arguments.
*/
$sidebar = wp_parse_args( $args, apply_filters( 'register_sidebar_defaults', $defaults ) );
if ( $id_is_empty ) {
_doing_it_wrong(