If you add this in the functions.php file in your themes folder:
add_filter('upload_dir', 'new_upload_dir');
function new_upload_dir( $param ){
$mydir="/wp-content/uploads";
$param['path'] = $param['path'] . $mydir;
$param['url'] = $param['url'] . $mydir;
error_log("path={$param['path']}");
error_log("url={$param['url']}");
error_log("subdir={$param['subdir']}");
error_log("basedir={$param['basedir']}");
error_log("baseurl={$param['baseurl']}");
error_log("error={$param['error']}");
return $param;
}
It should change the directory the images are uploaded into.
Related Posts:
- Limit Media Library to Given Folder
- Hide upload image fields for the different media upload popups
- I’m using add_meta_box() but want to include TinyMCE editor *and* Media Uploads for each box
- WordPress media uploader – upload tabs not hiding
- problem in uploading attachment to custom directory
- Can’t upload format files on media library
- How can I add a Description column to the media library browser screen?
- Rename UPLOADS folder with custom WP_CONTENT_DIR
- How to move wp-content (or uploads) outside of the WordPress directory
- Add more rows on media picker
- Automatically wrap post image in div
- media_handle_upload weird thing
- Looking to display non-image files in Gallery with logo specific to file type
- How do I go straight to “Edit More Details” when clicking on an item in the media library?
- Syncing Avatars across multisite
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- How to retrieve alt attribute for an attachment (uploaded image)?
- How to insert a sitemap within a subsite when using WordPress multisite
- Add a InfoBox in the media upload window
- custom upload directory only for plugin uploads
- Can I create my own custom Attachment Display Setting?
- Redirect to another page using contact form 7? [closed]
- Installing new theme on running site
- More Fields & Media Upload
- How to allow .bin files upload?
- Media Upload not working after hiding some elements from functions.php
- Personalized Gallery what are my options?
- the temporary save folder is wrong
- How to fix custom add menu page preventing media library from loading
- How do I enable the text editer in my WordPress theme? [closed]
- Is there a way to limit multi upload in media upload box?
- Organizing the Media Library for Cleanup
- Custom Link In WordPress Media “Attachment Details” Upload Screen
- How can I create more “create attachment” custom field – any idea?
- Upload files in wordpress
- Custom image sizes ignored in WP 3.5
- WordPress uploads directory. Featured Images storage
- How to disable the PDF preview in the file block by default
- Current menu item highlights wrong
- Adding a custom field to a slug
- Measure time in ONLY HOUR format
- Add admin page for specific post status (for example)
- Query Product categories what have a custom field
- Get /users/me details from WordPress backend
- mailchimp integration on a custom footer
- Can’t Customize WordPress Page
- ACF unable to use user field
- Bootstrap slider not working
- Use Theme CSS in custom code
- How to get the full product name by ignoring custom modification on it
- adding fade on mouseover to images
- where is admin footer?
- Customize section does not show my widget areas
- How can i add customisation of text to my theme?
- Add producthunt badge to wordpress menu
- Can I overwrite custom taxonomy FROM “public” TO “false”
- Is it possible to pull all featured images from WP database only?
- Show products per page drop down
- Trying to customise 2011 Child Theme Background Colour
- How to remove (…) from the post tilte on homepage?
- Is it possible to edit a wordpress category with Gutenberg?
- Widget recent comment filter by post meta_value
- Restrict Users to Only Edit Media Owned by Users in Their Role
- Invitation link to a site in multisite network does not work?
- Swap home page based on user role, Elementor layout breaking
- Add helper text in custom-header section in admin
- How to edit content in code view of home page when there is some theme applied?
- How to display strikethrough text in button text (for special offer)
- Adding shortcode to product short description
- Display Custom Taxonomy Name As A Shortcode
- How to change Login default blue admin color?
- Remove Title and White Space in Twenty Twenty theme
- How do i remove this from logged in users?
- Schedule a subscription on gravity form, stripe add-on
- How to show related post with category DESC (ASC) IDs of ID current post
- Lost customization after switching the WordPress theme
- How to show Term ID beside Name Category with wp_dropdown_categories()
- Gender based user avatar
- Migrating my site to a new domain does not keep any changes made in customizer
- Could creation of various image sizes cause slow form submission response?
- Woocommerce custom “My Account” Tab – Add Save button
- How to create custom backend admin menu in different languages?
- WordPress Using Zip code customer shop find without woocommerce plugin
- unsharp thumbnails after uploading image
- Is MultiSite the Correct Solution for a Corporate Site with Searchable Regions?
- How can I style the Comment Section of a blog post
- New to WP: links on static homepage are not working
- Taxonomy template is not reading
- Custom Meta Box: Value saved in WordPress DB, but not shown in input field on Edit Screen
- Conflict between Yoast SEO and my custom theme
- Custom post-type working except for Selecting page-parent
- Need to add custom text field to Woocommerce under add to cart button
- How to show the hero of website when sending website link?
- How can I display both LTR and RTL language texts on the same page?
- Remove Category titles from individual posts on archive pages
- How could I change contact details in the footer?
- Hide entry-header for a specific category
- Moving Quantity after product description
- Change HTML markup on blog post
- Editing a website made with wordpress