Skip to content

Commit

Permalink
Coding Standards: Reformat some long apply_filters_deprecated() and…
Browse files Browse the repository at this point in the history
… `do_action_deprecated()` calls for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48167 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jun 25, 2020
1 parent de36eb3 commit e65d19b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/js/_enqueues/wp/password-strength-meter.js
Expand Up @@ -62,7 +62,7 @@ window.wp = window.wp || {};
userInputBlacklist : function() {
window.console.log(
sprintf(
/* translators: 1: Deprecated JSfunction name, 2: Version number, 3: Alternative function name. */
/* translators: 1: Deprecated function name, 2: Version number, 3: Alternative function name. */
__( '%1$s is deprecated since version %2$s! Use %3$s instead. Please consider writing more inclusive code.' ),
'wp.passwordStrength.userInputBlacklist()',
'5.5.0',
Expand Down
7 changes: 6 additions & 1 deletion src/wp-admin/includes/image-edit.php
Expand Up @@ -372,7 +372,12 @@ function wp_save_image_file( $filename, $image, $mime_type, $post_id ) {
* @param string $mime_type The mime type of the image.
* @param int $post_id Attachment post ID.
*/
$saved = apply_filters_deprecated( 'wp_save_image_file', array( null, $filename, $image, $mime_type, $post_id ), '3.5.0', 'wp_save_image_editor_file' );
$saved = apply_filters_deprecated(
'wp_save_image_file',
array( null, $filename, $image, $mime_type, $post_id ),
'3.5.0',
'wp_save_image_editor_file'
);

if ( null !== $saved ) {
return $saved;
Expand Down
8 changes: 7 additions & 1 deletion src/wp-admin/options.php
Expand Up @@ -207,7 +207,13 @@
*
* @param array $allowed_options The allowed options list.
*/
$allowed_options = apply_filters_deprecated( 'whitelist_options', array( $allowed_options ), '5.5.0', 'apply_filters_deprecated', __( 'Please consider writing more inclusive code.' ) );
$allowed_options = apply_filters_deprecated(
'whitelist_options',
array( $allowed_options ),
'5.5.0',
'apply_filters_deprecated',
__( 'Please consider writing more inclusive code.' )
);

/**
* Filters the allowed options list.
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/capabilities.php
Expand Up @@ -372,7 +372,12 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
* @param string $cap Capability name.
* @param string[] $caps Array of the user's capabilities.
*/
$allowed = apply_filters_deprecated( "auth_{$object_type}_{$object_subtype}_meta_{$meta_key}", array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ), '4.9.8', "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" );
$allowed = apply_filters_deprecated(
"auth_{$object_type}_{$object_subtype}_meta_{$meta_key}",
array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ),
'4.9.8',
"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}"
);
}

if ( ! $allowed ) {
Expand Down
8 changes: 7 additions & 1 deletion src/wp-includes/comment.php
Expand Up @@ -1325,7 +1325,13 @@ function wp_blocklist_check( $author, $email, $url, $comment, $user_ip, $user_ag
* @param string $user_ip Comment author's IP address.
* @param string $user_agent Comment author's browser user agent.
*/
do_action_deprecated( 'wp_blacklist_check', array( $author, $email, $url, $comment, $user_ip, $user_agent ), '5.5.0', 'wp_blocklist_check', __( 'Please consider writing more inclusive code.' ) );
do_action_deprecated(
'wp_blacklist_check',
array( $author, $email, $url, $comment, $user_ip, $user_agent ),
'5.5.0',
'wp_blocklist_check',
__( 'Please consider writing more inclusive code.' )
);

/**
* Fires before the comment is tested for disallowed characters or words.
Expand Down
7 changes: 6 additions & 1 deletion src/wp-includes/ms-site.php
Expand Up @@ -132,7 +132,12 @@ function wp_insert_site( array $data ) {
* @param int $network_id Network ID. Only relevant on multi-network installations.
* @param array $meta Meta data. Used to set initial site options.
*/
do_action_deprecated( 'wpmu_new_blog', array( $new_site->id, $user_id, $new_site->domain, $new_site->path, $new_site->network_id, $meta ), '5.1.0', 'wp_insert_site' );
do_action_deprecated(
'wpmu_new_blog',
array( $new_site->id, $user_id, $new_site->domain, $new_site->path, $new_site->network_id, $meta ),
'5.1.0',
'wp_insert_site'
);
}

return (int) $new_site->id;
Expand Down

0 comments on commit e65d19b

Please sign in to comment.