mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Plugins: Consistently use an empty string as the default value for $replacement and $message parameters in:
* `_deprecated_function()` * `_deprecated_constructor()` * `_deprecated_file()` * `_deprecated_argument()` * `_deprecated_hook()` * `apply_filters_deprecated()` * `do_action_deprecated()` This matches the documented type of `string` for these parameters and removes unnecessarily strict `! is_null()` checks. Follow-up to [46792]. Props jignesh.nakrani, renathoc, SergeyBiryukov. Fixes #49698. git-svn-id: https://develop.svn.wordpress.org/trunk@48327 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -620,10 +620,10 @@ function remove_all_actions( $tag, $priority = false ) {
|
||||
* @param string $tag The name of the filter hook.
|
||||
* @param array $args Array of additional function arguments to be passed to apply_filters().
|
||||
* @param string $version The version of WordPress that deprecated the hook.
|
||||
* @param string $replacement Optional. The hook that should have been used. Default null.
|
||||
* @param string $message Optional. A message regarding the change. Default null.
|
||||
* @param string $replacement Optional. The hook that should have been used. Default empty.
|
||||
* @param string $message Optional. A message regarding the change. Default empty.
|
||||
*/
|
||||
function apply_filters_deprecated( $tag, $args, $version, $replacement = null, $message = null ) {
|
||||
function apply_filters_deprecated( $tag, $args, $version, $replacement = '', $message = '' ) {
|
||||
if ( ! has_filter( $tag ) ) {
|
||||
return $args[0];
|
||||
}
|
||||
@@ -647,10 +647,10 @@ function apply_filters_deprecated( $tag, $args, $version, $replacement = null, $
|
||||
* @param string $tag The name of the action hook.
|
||||
* @param array $args Array of additional function arguments to be passed to do_action().
|
||||
* @param string $version The version of WordPress that deprecated the hook.
|
||||
* @param string $replacement Optional. The hook that should have been used. Default null.
|
||||
* @param string $message Optional. A message regarding the change. Default null.
|
||||
* @param string $replacement Optional. The hook that should have been used. Default empty.
|
||||
* @param string $message Optional. A message regarding the change. Default empty.
|
||||
*/
|
||||
function do_action_deprecated( $tag, $args, $version, $replacement = null, $message = null ) {
|
||||
function do_action_deprecated( $tag, $args, $version, $replacement = '', $message = '' ) {
|
||||
if ( ! has_action( $tag ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user