• Resolved Michael

    (@michael8888)


    After upgrading from WordPress 4.5 to 4.6.1 the plugin ignores capital letters in file names (converts them to lower case) and it now ads hyphens to title, caption, and alt text fields.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author David Gwyer

    (@dgwyer)

    This looks like it could be new default behavior when uploading media items. I just ran a test on a local development site with no plugins active running WP 4.6.1.

    When an image was uploaded with a mixed case filename including hyphens and underscores the text was formatted to lowercase but the hyphens remained.

    Can you tell me what plugin settings were you using and the name of the original image filename that was uploaded?

    Thread Starter Michael

    (@michael8888)

    Thanks for the response. My settings were “Don’t Alter (title text isn’t modified in any way)”, “Add Title to ‘Alternative Text’ Field?” and “Add Title to ‘Caption’ Field?” The rest was disabled. The problem occurred with any mixed case filename containing hyphens.

    I think this is a WordPress bug. If the plugin is disabled and you upload an image, WordPress no longer creates a correct media item title. As you said, it formats the title to lower case and it doesn’t remove the hyphens from the filename as it did before 4.6. However, it does not format the filename to lower case. This doesn’t make sense.

    As a workaround, I replaced “$title = $uploaded_post_id->post_title;” in your plugin with

    $file = get_attached_file($id);
    $path = pathinfo($file);
    $title = $path[‘filename’];

    I also enabled “Remove Hyphens” in the plugin now. The only problem is that this also removes hyphens that belong to the media title (and not just to the filename).

    Plugin Author David Gwyer

    (@dgwyer)

    I’m not sure if it’s a bug but WP 4.6.1 does seem to be formatting media titles to lower case for some reason. Filenames are always unaffected.

    Whilst testing the cause for this I added code, similar to what you posted, to the Pro version to use the media item filename instead of the WP ‘formatted’ title. It worked well.

    I assume that most of your media items have the filename with capitalization just the way you want to keep it. So after upload the media title will be exactly the filename but with hyphens removed.

    I’m considering adding to the next release Pro version options to choose the source for the title formatting. This way you would be able to choose the source title rather than it being fixed to the filename or the pre formatted title from WP.

    This is indeed a WordPress change in 4.6.x. See this related topic:

    Uploads Changed To Lower Case

    Plugin Author David Gwyer

    (@dgwyer)

    Thanks for posting. It may well revert in the next version of WordPress so I think I’ll wait and see before making any changes.

    Plugin Author David Gwyer

    (@dgwyer)

    Looks like this is fixed in the latest development version of WP 4.7, so should be rolled out with the official release.

    Plugin Author David Gwyer

    (@dgwyer)

    Marking as resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Plugin no longer works properly with WordPress 4.6.1’ is closed to new replies.