• Resolved shesma

    (@shesma)


    Hello,

    Thank you for the lovely plugin.

    The get_permalink function saves the image with a name of the permalink slug.

    This is causing a problem and the image is not being saved properly as the slug on my settings is in Arabic.

    Can you please help me in making the name generate from post ID instead or any other value?

    Thanks a lot.

    https://www.ads-software.com/extend/plugins/video-thumbnails/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Thanks for figuring out the cause of this problem shesma, I’ve proposed a solution in this thread but I’ll repost it here.

    Open up video-thumbnails.php and find the line

    $new_filename = basename( get_permalink( $post_id ) ) . $image_extension;

    and replace it with

    $new_filename = urldecode( basename( get_permalink( $post_id ) ) ) . $image_extension;

    If you can test this out and let me know that’d be great! Please test it with titles using the latin alphabet too.

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Just released version 2.0.4 which includes this fix.

    There are still problems with the “basename” approach when it comes to non-Latin languages, such as Arabic. It is simpler and more efficient to just rewrite the above statement to:

    $new_filename = urldecode( $post_id ) . $image_extension;

    This way, the image filename corresponds with the post ID, and it does not matter what language the post was written in.

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    @halkibsi I’ll look into this as a fallback for certain languages, but I used to have complaints about image filenames that were only using numbers.

    In that case a fallback solution is the way to go as long as you give users that choice in the plugins options/settings page. Thanks Sutherland for your hard work and wonderful plugin. ??

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Version 2.4.1 is out now! Filenames are now limited to 32 characters. Any non-latin characters are removed so you don’t end up with strange names, and the post ID will be used as a fallback.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change auto image name’ is closed to new replies.