_wp_relative_upload_path
Filters the relative path to an uploaded file.
Usage
add_filter( '_wp_relative_upload_path', 'wp_kama__wp_relative_upload_path_filter', 10, 2 );
/**
* Function for `_wp_relative_upload_path` filter-hook.
*
* @param string $new_path Relative path to the file.
* @param string $path Full path to the file.
*
* @return string
*/
function wp_kama__wp_relative_upload_path_filter( $new_path, $path ){
// filter...
return $new_path;
}
- $new_path(string)
- Relative path to the file.
- $path(string)
- Full path to the file.
Changelog
| Since 2.9.0 | Introduced. |
Where the hook is called
_wp_relative_upload_path
wp-includes/post.php 936
return apply_filters( '_wp_relative_upload_path', $new_path, $path );