• Resolved mariodrolet

    (@mariodrolet)


    I am trying the free version of the plugin to see if it would serve my purpose and so far something basic as adding the posttitle to the file name at upload time doesn’t work.
    I have the rule set as {filename}{posttitle}
    I have a photo gallery plugin that I use and can upload photos at the same time as creating a new gallery. This way, the files are being renamed where they are changed to lowercase and the _ is change to – so this is good, but the post title is never added to the filename.
    I have tried doing this directly from the Media Gallery as well and the same occurres, the post title is never added to the file name.
    Any help would be greatly appreciated.

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Pablo Pacheco

    (@karzin)

    Hello @mariodrolet ,

    What is the photo gallery plugin?
    Maybe I can take a look and check if I can add compatibility to it

    Thread Starter mariodrolet

    (@mariodrolet)

    Hi Pablo,

    Thanks for the reply.
    I am using this Photo Gallery from 10web https://en-ca.www.ads-software.com/plugins/photo-gallery/

    Although a new gallery is essentially a post I thought that the {posttitle} rule might only apply to actual posts.

    It would be really great if it could rename the photos including the gallery name (post title) during uploads. Even if it is a custom code I would be willing to try this out and would solve my problem.

    Thank you,
    Mario

    Plugin Author Pablo Pacheco

    (@karzin)

    I’m sorry but I just checked their code and it seems that they don’t provide any useful hook I could use in order to rename the files.

    Besides that, they use a different upload system, I mean, they are not using the default WordPress media library, so I’m afraid it won’t be possible to make it compatible with the File Renaming plugin ??

    Thread Starter mariodrolet

    (@mariodrolet)

    Fare enough, thanks for looking into it.

    Thread Starter mariodrolet

    (@mariodrolet)

    Hi Pablo,

    Thought of something else. If I were to upload through the WP Media Library as opposed to directly from the Photo Gallery, I should be able to rename the files that way, obviously not pulling a posttitle dynamically, but does your plugin allow me to use a custom rule using a string.
    Something like {filename}”customstring” as a rule, even if I have to write some code for it I’m fine with that.

    Thanks in advance for your help.

    Plugin Author Pablo Pacheco

    (@karzin)

    Hi,

    Yes, you can create a custom rule like {customstring} as you suggested.
    It would work like:

    add_filter( 'frou_sanitize_file_name', function($filename_infs){
        $filename_infs['structure']['translation']['customstring'] = 'my-custom-string'
        return $filename_infs;
    }, 20 );

    You’d just have to decide what you want to add on the custom string and if it’s possible too.

    • This reply was modified 3 years, 8 months ago by Pablo Pacheco.
    Thread Starter mariodrolet

    (@mariodrolet)

    Hi Pablo,

    Thank you, this totally works.
    As a request, if you are so inclined to add this to your plugin (i would even pay for the premium version to have that), would be to have that custom string rule in your setting page so you could enable it and provide the custom string there, similar to the siteurl and datetime rules.

    Thanks again for your help.
    Mario

    Plugin Author Pablo Pacheco

    (@karzin)

    Hi @mariodrolet ,

    No problem.
    I just released a new release of pro version (1.2.5) with the new Custom string rule for you.

    I hope you try it ??

    Thread Starter mariodrolet

    (@mariodrolet)

    Hi Pablo,

    Just upgraded to the pro version and this is perfect for me.
    Thank you for the quick response

    Mario

    Plugin Author Pablo Pacheco

    (@karzin)

    Great!

    Thanks for letting me know ??
    See you

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘{posttitle} rule doesn’t work’ is closed to new replies.