The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
How to modify the l...
 
Share:
Notifications
Clear all

[Solved] How to modify the location of wpDiscuz attachments.

1 Posts
1 Users
1 Reactions
535 Views
Asti
 Asti
(@asti)
Illustrious Member Support
Joined: 7 years ago
Posts: 7673
Topic starter  

Starting from wpDiscuz version 7.6.20, you can modify the location of wpDiscuz attachments using the wpdiscuz_uploads_folderΒ hook.Β 

The code snippet below allows you to create a new folder within the '/uploads' directory, where all wpDiscuz attachments will be stored:

add_filter("wpdiscuz_uploads_folder", function ($dir) {
    $dir  = "wpdiscuz_uploads";
    return $dir;
});

Insert this hook code into the functions.php file of your active WordPress theme. For more information on how to add custom code, refer to this guide: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

Important: This code will only affect new attachments. Previously inserted images will not display on the frontend because the path has already changed. To resolve this issue, you'll need to update the existing attachment paths in the database.

We strongly recommend backing up your database tables before making any changes.

If you’re not familiar with database structure and are unable to change the paths yourself, we recommend contacting paid plugin customization and custom addon development services through the gVectors Team. They can assess the work and create the necessary changes for you. Just contact us via sales[at]gvectors.com email address and send a list of requirements you'd like to have.

In case you want to say thank you! πŸ™‚
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.


   
Jacob reacted
Share: