Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- function directory_control_uploads( $uploads ) {
- if ( defined( 'WP_UPLOAD_DIR' ) ) {
- $uploads['path'] = str_replace( WP_CONTENT_DIR . '/uploads', WP_UPLOAD_DIR, $uploads['path'] );
- $uploads['basedir'] = str_replace( WP_CONTENT_DIR . '/uploads', WP_UPLOAD_DIR, $uploads['basedir'] );
- }
- if ( defined( 'WP_UPLOAD_URL' ) ) {
- $uploads['url'] = str_replace( WP_CONTENT_URL . '/uploads', WP_UPLOAD_URL, $uploads['url'] );
- $uploads['baseurl'] = str_replace( WP_CONTENT_URL . '/uploads', WP_UPLOAD_URL, $uploads['baseurl'] );
- }
- return $uploads;
- }
- function directory_control_theme_dir( $dir ) {
- if ( defined( 'WP_THEME_DIR' ) ) {
- $dir = str_replace( WP_CONTENT_DIR . '/themes', WP_THEME_DIR, $dir );
- }
- return $dir;
- }
- function directory_control_theme_url( $url ) {
- if ( defined( 'WP_THEME_URL' ) ) {
- $search = set_url_scheme( WP_CONTENT_URL . '/themes' );
- $replace = set_url_scheme( WP_THEME_URL );
- $url = str_replace( $search, $replace, $url );
- }
- return $url;
- }
- add_filter( 'upload_dir', 'directory_control_uploads', 1 );
- add_filter( 'theme_root', 'directory_control_theme_dir', 1 );
- add_filter( 'theme_root_uri', 'directory_control_theme_url', 1 );
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement