Make WordPress Core

Ticket #28449: 28449-the_content-orphans.patch

File 28449-the_content-orphans.patch, 640 bytes (added by dcondrey, 9 years ago)

patch

  • src/wp-includes/post-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    220220         */
    221221        $content = apply_filters( 'the_content', $content );
    222222        $content = str_replace( ']]>', ']]&gt;', $content );
     223    /** Add &nbsp; before last word to prevent widow */
     224    $content = preg_replace('/\s([\w]+[.,!\:;\\"-?]{0,1})$/', '&nbsp;\\1', $content);
    223225        echo $content;
    224226}
    225227