Title: apply_filters_deprecated
Published: August 16, 2016
Last modified: August 20, 2026

---

# apply_filters_deprecated( string $hook_name, array $args, string $version, string $replacement = '', string $message = '' ): mixed

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#wp--skip-link--target)

Fires functions attached to a deprecated filter hook.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#description)󠁿

When a filter hook is deprecated, the [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)
call is replaced with [apply_filters_deprecated()](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/),
which triggers a deprecation notice and then fires the original filter hook.

Note: the value and extra arguments passed to the original [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)
call must be passed here to `$args` as an array. For example:

    ```php
    // Old filter.
    return apply_filters( 'wpdocs_filter', $value, $extra_arg );

    // Deprecated.
    return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9.0', 'wpdocs_new_filter' );
    ```

### 󠀁[See also](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#see-also)󠁿

 * [_deprecated_hook()](https://developer.wordpress.org/reference/functions/_deprecated_hook/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#parameters)󠁿

 `$hook_name`stringrequired

The name of the filter hook.

`$args`arrayrequired

Array of additional function arguments to be passed to [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/).

More Arguments from apply_filters( … $args )

Additional parameters to pass to the callback functions.

`$version`stringrequired

The version of WordPress that deprecated the hook.

`$replacement`stringoptional

The hook that should have been used.

Default:`''`

`$message`stringoptional

A message regarding the change.

Default:`''`

## 󠀁[Return](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#return)󠁿

 mixed The filtered value after all hooked functions are applied to it.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#source)󠁿

    ```php
    function apply_filters_deprecated( $hook_name, $args, $version, $replacement = '', $message = '' ) {
    	if ( ! has_filter( $hook_name ) ) {
    		return $args[0];
    	}

    	_deprecated_hook( $hook_name, $version, $replacement, $message );

    	return apply_filters_ref_array( $hook_name, $args );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/plugin.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/plugin.php#L723)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/plugin.php#L723-L731)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#related)󠁿

| Uses | Description | 
| [_deprecated_hook()](https://developer.wordpress.org/reference/functions/_deprecated_hook/)`wp-includes/functions.php` |

Marks a deprecated action or filter hook as deprecated and throws a notice.

  | 
| [has_filter()](https://developer.wordpress.org/reference/functions/has_filter/)`wp-includes/plugin.php` |

Checks if any filter has been registered for a hook.

  | 
| [apply_filters_ref_array()](https://developer.wordpress.org/reference/functions/apply_filters_ref_array/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook, specifying arguments in an array.

  |

| Used by | Description | 
| [get_block_editor_settings()](https://developer.wordpress.org/reference/functions/get_block_editor_settings/)`wp-includes/block-editor.php` |

Returns the contextualized block editor settings for a selected editor context.

  | 
| [block_editor_rest_api_preload()](https://developer.wordpress.org/reference/functions/block_editor_rest_api_preload/)`wp-includes/block-editor.php` |

Preloads common data used with the block editor by specifying an array of REST API paths that will be preloaded for a given block editor context.

  | 
| [get_allowed_block_types()](https://developer.wordpress.org/reference/functions/get_allowed_block_types/)`wp-includes/block-editor.php` |

Gets the list of allowed block types to use in the block editor.

  | 
| [get_block_categories()](https://developer.wordpress.org/reference/functions/get_block_categories/)`wp-includes/block-editor.php` |

Returns all the categories for block types that will be shown in the block editor.

  | 
| [_wp_privacy_send_request_confirmation_notification()](https://developer.wordpress.org/reference/functions/_wp_privacy_send_request_confirmation_notification/)`wp-includes/user.php` |

Notifies the site administrator via email when a request is confirmed.

  | 
| [_wp_privacy_send_erasure_fulfillment_notification()](https://developer.wordpress.org/reference/functions/_wp_privacy_send_erasure_fulfillment_notification/)`wp-includes/user.php` |

Notifies the user when their erasure request is fulfilled.

  | 
| [WP_Privacy_Policy_Content::get_default_content()](https://developer.wordpress.org/reference/classes/wp_privacy_policy_content/get_default_content/)`wp-admin/includes/class-wp-privacy-policy-content.php` |

Returns the default suggested privacy policy content.

  | 
| [WP_Site::get_details()](https://developer.wordpress.org/reference/classes/wp_site/get_details/)`wp-includes/class-wp-site.php` |

Retrieves the details for this site.

  | 
| [WP_REST_Server::serve_request()](https://developer.wordpress.org/reference/classes/wp_rest_server/serve_request/)`wp-includes/rest-api/class-wp-rest-server.php` |

Handles serving a REST API request.

  | 
| [login_header()](https://developer.wordpress.org/reference/functions/login_header/)`wp-login.php` |

Outputs the login page header.

  | 
| [validate_another_blog_signup()](https://developer.wordpress.org/reference/functions/validate_another_blog_signup/)`wp-signup.php` |

Validates a new site sign-up for an existing user.

  | 
| [WP_Screen::render_screen_meta()](https://developer.wordpress.org/reference/classes/wp_screen/render_screen_meta/)`wp-admin/includes/class-wp-screen.php` |

Renders the screen’s help section.

  | 
| [wp_save_image_file()](https://developer.wordpress.org/reference/functions/wp_save_image_file/)`wp-admin/includes/image-edit.php` |

Saves image to file.

  | 
| [image_edit_apply_changes()](https://developer.wordpress.org/reference/functions/image_edit_apply_changes/)`wp-admin/includes/image-edit.php` |

Performs group of changes on Editor specified.

  | 
| [wp_stream_image()](https://developer.wordpress.org/reference/functions/wp_stream_image/)`wp-admin/includes/image-edit.php` |

Streams image in [WP_Image_Editor](https://developer.wordpress.org/reference/classes/wp_image_editor/) to browser.

  | 
| [media_buttons()](https://developer.wordpress.org/reference/functions/media_buttons/)`wp-admin/includes/media.php` |

Adds the media button to the editor.

  | 
| [WP_Terms_List_Table::prepare_items()](https://developer.wordpress.org/reference/classes/wp_terms_list_table/prepare_items/)`wp-admin/includes/class-wp-terms-list-table.php` |  | 
| [map_meta_cap()](https://developer.wordpress.org/reference/functions/map_meta_cap/)`wp-includes/capabilities.php` |

Maps a capability to the primitive capabilities required of the given user to satisfy the capability being checked.

  | 
| [WP::build_query_string()](https://developer.wordpress.org/reference/classes/wp/build_query_string/)`wp-includes/class-wp.php` |

Sets the query string property based off of the query variable property.

  | 
| [WP_Http::_get_first_available_transport()](https://developer.wordpress.org/reference/classes/wp_http/_get_first_available_transport/)`wp-includes/class-wp-http.php` |

Tests which transports are capable of supporting the request.

  | 
| [get_posts_by_author_sql()](https://developer.wordpress.org/reference/functions/get_posts_by_author_sql/)`wp-includes/post.php` |

Retrieves the post SQL based on capability, author, and type.

  | 
| [WP_Rewrite::mod_rewrite_rules()](https://developer.wordpress.org/reference/classes/wp_rewrite/mod_rewrite_rules/)`wp-includes/class-wp-rewrite.php` |

Retrieves mod_rewrite-formatted rewrite rules to write to .htaccess.

  | 
| [WP_Rewrite::rewrite_rules()](https://developer.wordpress.org/reference/classes/wp_rewrite/rewrite_rules/)`wp-includes/class-wp-rewrite.php` |

Constructs rewrite matches and queries from permalink structure.

  | 
| [get_blog_details()](https://developer.wordpress.org/reference/functions/get_blog_details/)`wp-includes/ms-blogs.php` |

Retrieves the details for a blog from the blogs table and blog options.

  | 
| [_WP_Editors::editor()](https://developer.wordpress.org/reference/classes/_wp_editors/editor/)`wp-includes/class-wp-editor.php` |

Outputs the HTML for a single instance of the editor.

  |

[Show 20 more](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/apply_filters_deprecated/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fapply_filters_deprecated%2F)
before being able to contribute a note or feedback.