Support

Account

Home Forums General Issues Rename and relocate uploaded Images Reply To: Rename and relocate uploaded Images

  • Hmm…
    So, you can add a custom setting to a field, to all Images…
    I guess you’re saying I would hitch a new field to every Image field in the admin.

    I’m not sure if that would achieve the aim (would it?). Maybe I don’t want to work on *all* Images, ie. if the user has more than one Image field/purpose on-site…

    If the aim is to relocate images uploaded to the Image field in a group that sits on the term-edit page for all Company taxonomy terms… don’t I need to set a folder path value at the Company (taxonomy) level (ie. wp-content/uploads/{specific-folder}/{specific-subfolder}`)?

    I don’t currently have any “taxonomy” (Company) page on which I think a group/field could be added. Unless ACF can put anything on the listing page edit-tags.php?taxonomy=company … Yes, I note ACF Extended enables support for <a href=”https://www.acf-extended.com/features/field-groups/locations/taxonomy-list”>Taxonomy List</a>.

    Hmm, should I be putting a Text field on Taxonomy List for “Logo Image Directory” (eg. “/company/logos“)?

    If I then filter the actual uploads, I’d need some way to check against the above value to get the directory… ?

    Seems a bit convoluted and not necessarily like I could make it a neat plugin package… (?).

    Rather, maybe I shouldn’t bother with <em>specifying</em> an image directory and just <em>infer</em> it…

    ie. 1 /wp-content/uploads/{taxonomy_slug}/{acf_field_name}/{term_slug.ext} ?

    eg. 1 /wp-content/uploads/company/logo/microsoft.png ?

    Yes, though then I think I need to overcome two things…

    <strong>A. Application to other objects beside taxonomy…</strong>

    ie. 2. /wp-content/uploads/user/{acf_field_name}/{username.ext}

    eg. 2 /wp-content/uploads/user/avatar/billgates.png ?

    Achieved through some conditionals/check against object type? Not certain how, maybe the same way I’m already getting the URL parameters.

    <strong>B. Any way to avoid hard-coding/pre-specifying the field name and field key?</strong>

    Can “field_6140a6da30a17” and “avatar“/”logo" be auto-obtained, so that this could just work on anything, I wonder?

    Thinking in public.