sanitize_file_name_chars WordPress Filter Hook

The sanitize_file_name_chars hook is used to filter out invalid characters in a file name. This is useful when you want to ensure that a file name is safe to use on a specific platform or file system.

apply_filters( 'sanitize_file_name_chars', string[] $special_chars, string $filename_raw ) #

Filters the list of characters to remove from a filename.


Parameters

$special_chars

(string[])Array of characters to remove.

$filename_raw

(string)The original filename to be sanitized.


Top ↑

Source

File: wp-includes/formatting.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More