[wp-trac] [WordPress Trac] #37989: Unexpected change to media title behavior in WP 4.6.1
WordPress Trac
noreply at wordpress.org
Sun Oct 2 06:41:49 UTC 2016
#37989: Unexpected change to media title behavior in WP 4.6.1
--------------------------------------------------+------------------------
Reporter: arhenderson63 | Owner: joemcgill
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.6.2
Component: Media | Version: 4.6.1
Severity: major | Resolution:
Keywords: has-patch has-unit-tests fixed-major | Focuses:
--------------------------------------------------+------------------------
Comment (by oldrup):
Dear @SergeyBiryukov
Thank you VERY much for pointing that side-effect out. Obviously I do NOT
want spaces and stuff like that in my slugs...
Yes, I just gave the workaround in comment #11 a shot, and it works
beautifully, just what I need. The titles are fine again, and slugs not
affected. Thanks!
Bjarne
Replying to [comment:58 SergeyBiryukov]:
> Replying to [comment:56 oldrup]:
> > This snippet works for me, leaving the title alone.
> > {{{
> > /* Don't sanitize title of uploaded files */
> > add_filter( 'sanitize_title', function( $changed, $raw ) {
> > return $raw;
> > }, PHP_INT_MAX, 2 );
> > }}}
>
> It would also affect post slugs though, as they would no longer be run
through `sanitize_title_with_dashes()` and might contain spaces and other
characters: `http://example.com/2016/10/My%20new%20post/`.
>
> Have you tried the snippet from comment:11?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37989#comment:59>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list