wp_relative_upload_path
Filters the relative path to an uploaded file.
Description
Parameters (2)
Usage
- To run the hook, copy the example below.
- $wpcom_wp_relative_upload_path = apply_filters( 'wp_relative_upload_path', $wpcom_wp_relative_upload_path, $int );
- if ( !empty( $wpcom_wp_relative_upload_path ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_relative_upload_path callback
- function filter_wp_relative_upload_path( $wpcom_wp_relative_upload_path, $int ) {
- // make filter magic happen here...
- return $wpcom_wp_relative_upload_path;
- };
- // add the filter
- add_filter( 'wp_relative_upload_path', 'filter_wp_relative_upload_path', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'wp_relative_upload_path', 'filter_wp_relative_upload_path', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /class.json-api-endpoints.php
- remove_filter( '_wp_relative_upload_path', 'wpcom_wp_relative_upload_path', 10 );