diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 8bb89b7ceb5a4..1d6962a54690f 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -3047,12 +3047,13 @@ function _wp_register_initial_settings_for_abilities(): void { * @global array $new_allowed_options * @global array $wp_registered_settings * - * @param string $option_group A settings group name. Should correspond to an allowed option key name. - * Default allowed option key names include 'general', 'discussion', 'media', - * 'reading', 'writing', and 'options'. - * @param string $option_name The name of an option to sanitize and save. - * @param array $args { - * Data used to describe the setting when registered. + * @param string $option_group A settings group name. Should correspond to an allowed option key name. + * Default allowed option key names include 'general', 'discussion', 'media', + * 'reading', 'writing', and 'options'. + * @param string $option_name The name of an option to sanitize and save. + * @param array|callable $args { + * Data used to describe the setting when registered. For backward compatibility, a callable + * may be passed instead, which is used as the `$sanitize_callback`. * * @type string $type The type of data associated with this setting. * Valid values are 'string', 'boolean', 'integer', 'number', 'array', diff --git a/tests/phpstan/baselines/argument.type.neon b/tests/phpstan/baselines/argument.type.neon index b2a294f1b58b9..5438195438f19 100644 --- a/tests/phpstan/baselines/argument.type.neon +++ b/tests/phpstan/baselines/argument.type.neon @@ -418,11 +418,6 @@ parameters: identifier: argument.type count: 1 path: ../../../src/wp-content/themes/twentyeleven/inc/theme-options.php - - - message: '#^Parameter \#3 \$args of function register_setting expects array\{type\?\: string, label\?\: string, description\?\: string, sanitize_callback\?\: \(callable\(\)\: mixed\)\|null, show_in_rest\?\: array\|bool, show_in_abilities\?\: array\|bool, default\?\: mixed, \.\.\.\}, ''twentyeleven_theme…'' given\.$#' - identifier: argument.type - count: 1 - path: ../../../src/wp-content/themes/twentyeleven/inc/theme-options.php - message: '#^Parameter \#3 \$deps of function wp_enqueue_style expects array\, false given\.$#' identifier: argument.type