WordPress.org

Forums

Media Manager > Overwrite media without appending a "1" to it (4 posts)

  1. vestaviascott
    Member
    Posted 5 years ago #

    Is their a setting that will tell WP that when I upload a file via the Media manager that has the same file name as an existing file, I want it to overwrite the existing file?

    The current behavior is that it

    1. Does not tell me there is an existing file of the same name
    2. Does not offer to give me the choice to overwrite the existing file OR create a new file and...
    3. Is completely counterintuitive and confusing without 1 and 2 above

    Is their a setting like say, allow_media_overwrites_by_default or even better prompt_for_media_overwrites

    ???

  2. vestaviascott
    Member
    Posted 5 years ago #

    If the above option is not possible, then I'd look for suggestions on how to do a workaround by doing the following...

    since the image will named be something like...

    blue-yoga-mat-11.jpg

    OR

    blue-yoga-mat-21.jpg

    And I'm expecting an image like

    blue-yoga-mat-1.jpg

    OR

    blue-yoga-mat-2.jpg

    Is their a way I could use regex or string manipulation to just find a match on the pattern blue-yoga-mat-1 ?

    Example, I'm preloading four images, and I'm expecting them to be blue-yoga-mat-1.jpg, blue-yoga-mat-2.jpg, blue-yoga-mat-3.jpg, blue-yoga-mat-4.jpg

    But the way WP works, these files might actually be named blue-yoga-mat-11.jpg, blue-yoga-mat-21.jpg, etc

    My img tag looks like this...

    <img src="blue-yoga-mat-1.jpg" />

    But if that's not available, I'd just like it to load any image that matches the pattern blue-yoga-mat-1, so it could dynamically search and discover that the closest match is blue-yoga-mat-11.jpg and make the img tag...

    <img src="blue-yoga-mat-12.jpg" />

    Clear as mud?

  3. vestaviascott
    Member
    Posted 5 years ago #

    Anyone? I'm dying for a solution to this :-)

  4. charleyramm
    Member
    Posted 5 years ago #

    I am suffering from this issue too. It also affects whether your pictures get 'attached' to a new post. If there is a file of the same name, they don't get attached, and don't appear in the post gallery!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.