• Resolved Anonymous User 20238576

    (@anonymized-20238576)


    Hello,

    I installed your plugin because I wanted to add the following PHP code:

    update_option('upload_url_path', 'resources');

    This code should change the default WordPress URL address for media upload files.

    However I didn’t like it, it was the wrong code and all my images went missing, because it didn’t include my website URL.

    I decided to deactivate this code snippet but my images are still not showing.

    The URL address for media files did not revert back to the original ones.

    Can you please help me solve this issue?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @tomanuel,

    The code snippet is no longer active if you deactivated it but in this case, the code you used updates that value in the database so the change is stored until updated to another value.

    If you want to quickly fix the issue you will need to edit the snippet you previously used to make the change and use the correct value for your site and then deactivate the snippet.

    I would advise against making such changes directly through a snippet as that will execute a query to the db each time and if you do decide to change the upload_url_path this way you should either deactivate the snippet after making the change or use a filter to return the desired value before it is loaded from the database.

    Thread Starter Anonymous User 20238576

    (@anonymized-20238576)

    If you want to quickly fix the issue you will need to edit the snippet you previously used to make the change and use the correct value for your site and then deactivate the snippet.

    Can you please advise me in this? What exact correct value would be?

    Can you please write me a code for this? I am not experienced in this :/

    I want my images back lol. They are missing on the whole site.

    Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @tomanuel,

    By default, I think that value should be empty so I would try setting it to that:

    update_option( 'upload_url_path', '' );

    You could also try deleting the option but I am not sure of your setup so please proceed with caution.

    Thread Starter Anonymous User 20238576

    (@anonymized-20238576)

    You’re the man.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Code snippet is still active after deactivation’ is closed to new replies.