WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
| Line | Code |
|---|---|
| 1785 | if ( count( $parts ) <= 2 ) { |
| 1786 | /** |
| 1787 | * Filters a sanitized filename string. |
| 1788 | * |
| 1789 | * @since 2.8.0 |
| 1790 | * |
| 1791 | * @param string $filename Sanitized filename. |
| 1792 | * @param string $filename_raw The filename prior to sanitization. |
| 1793 | */ |
| 1794 | return apply_filters( 'sanitize_file_name', $filename, $filename_raw ); |
| 1795 | } |
| 1796 | |
| 1797 | // Process multiple extensions |
| 1798 | $filename = array_shift($parts); |
| 1799 | $extension = array_pop($parts); |
| 1800 | $mimes = get_allowed_mime_types(); |
| 1801 | |
| 1802 | /* |
| 1803 | * Loop over any intermediate extensions. Postfix them with a trailing underscore |
| Line | Code |
| 1815 | break; |
| 1816 | } |
| 1817 | } |
| 1818 | if ( !$allowed ) |
| 1819 | $filename .= '_'; |
| 1820 | } |
| 1821 | } |
| 1822 | $filename .= '.' . $extension; |
| 1823 | /** This filter is documented in wp-includes/formatting.php */ |
| 1824 | return apply_filters('sanitize_file_name', $filename, $filename_raw); |
| 1825 | } |
| 1826 | |
| 1827 | /** |
| 1828 | * Sanitizes a username, stripping out unsafe characters. |
| 1829 | * |
| 1830 | * Removes tags, octets, entities, and if strict is enabled, will only keep |
| 1831 | * alphanumeric, _, space, ., -, @. After sanitizing, it passes the username, |
| 1832 | * raw username (the username in the parameter), and the value of $strict as |
| 1833 | * parameters for the {@see 'sanitize_user'} filter. |