Home/Hooks/_wp_relative_upload_path
FILTER

_wp_relative_upload_path

Filters the relative path to an uploaded file.

wp-includes/post.php
Line 916
2 Parameters
View Source

Usage

add_filter( '_wp_relative_upload_path', 'your_callback_function', 10, 2 );

Filter Callback:

function your_callback_function( $new_path, $path ) {
    // Your code here
    return $new_path;
}

Parameters

$new_path

Parameter 1

$path

Parameter 2

🔄 Filter Hook

Filter hooks allow you to modify data before it is saved to the database or displayed on the screen. Filters must return a value.