Index: src/wp-includes/default-filters.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/wp-includes/default-filters.php	(revision 0d65892e296ea0f837b32924f21cc215f0b2d7aa)
+++ src/wp-includes/default-filters.php	(revision )
@@ -95,6 +95,7 @@
 	add_filter( $filter, 'wptexturize'   );
 	add_filter( $filter, 'convert_chars' );
 	add_filter( $filter, 'esc_html'      );
+	add_filter( $filter, 'prevent_orphans'  );
 }
 
 // Format WordPress
@@ -106,6 +107,7 @@
 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) {
 	add_filter( $filter, 'wptexturize' );
 	add_filter( $filter, 'strip_tags'  );
+	add_filter( $filter, 'prevent_orphans'  );
 }
 
 // Format text area for display.
@@ -114,6 +116,7 @@
 	add_filter( $filter, 'convert_chars'    );
 	add_filter( $filter, 'wpautop'          );
 	add_filter( $filter, 'shortcode_unautop');
+	add_filter( $filter, 'prevent_orphans'  );
 }
 
 // Format for RSS
@@ -124,9 +127,10 @@
 add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 );
 
 // Display filters
-add_filter( 'the_title', 'wptexturize'   );
+add_filter( 'the_title', 'wptexturize'    );
-add_filter( 'the_title', 'convert_chars' );
+add_filter( 'the_title', 'convert_chars'  );
-add_filter( 'the_title', 'trim'          );
+add_filter( 'the_title', 'trim'           );
+add_filter( 'the_title', 'prevent_orphans');
 
 add_filter( 'the_content', 'wptexturize'        );
 add_filter( 'the_content', 'convert_smilies'    );
@@ -134,12 +138,14 @@
 add_filter( 'the_content', 'wpautop'            );
 add_filter( 'the_content', 'shortcode_unautop'  );
 add_filter( 'the_content', 'prepend_attachment' );
+add_filter( 'the_content', 'prevent_orphans'    );
 
 add_filter( 'the_excerpt',     'wptexturize'      );
 add_filter( 'the_excerpt',     'convert_smilies'  );
 add_filter( 'the_excerpt',     'convert_chars'    );
 add_filter( 'the_excerpt',     'wpautop'          );
 add_filter( 'the_excerpt',     'shortcode_unautop');
+add_filter( 'the_excerpt',     'prevent_orphans'  );
 add_filter( 'get_the_excerpt', 'wp_trim_excerpt'  );
 
 add_filter( 'comment_text', 'wptexturize'            );
@@ -148,8 +154,10 @@
 add_filter( 'comment_text', 'force_balance_tags', 25 );
 add_filter( 'comment_text', 'convert_smilies',    20 );
 add_filter( 'comment_text', 'wpautop',            30 );
+add_filter( 'comment_text', 'prevent_orphans'        );
 
 add_filter( 'comment_excerpt', 'convert_chars' );
+add_filter( 'comment_excerpt', 'prevent_orphans' );
 
 add_filter( 'list_cats',         'wptexturize' );
 
Index: src/wp-includes/formatting.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/wp-includes/formatting.php	(revision 0d65892e296ea0f837b32924f21cc215f0b2d7aa)
+++ src/wp-includes/formatting.php	(revision )
@@ -533,6 +533,36 @@
 }
 
 /**
+ * Prevent orphan or widow words wrapping to new line
+ * @param $text
+ * @param $min Optional. Words to wrap. Default 2.
+ * @param $special Optional. Boolean to add all UNICODE expressions of space. Array to explicitly specify chars to split on.
+ *
+ * @return string
+ */
+function prevent_orphans($text,$min,$special) {
+	// if not specified, wrap 2 characters
+	if ( ! $min ) $min = 2;
+	// default = basic space, double space, en-space, em-space, mid-space, thin-space, ideographic space, horizontal tab,
+	$space = [' ','  ',"&ensp;","&#8194;","&emsp;","&#8195;","&#8197;","&#x2005;","&thinsp;","&#8201;","&#12288;","&#x3000;","&#009;"];
+	// if set but not explicitly specified.. add more special representations of space
+	if ( $special == true ) $special = [ "&nbsp;","&#160;","&#xA0;","&#x0A0;","&#x00A0;","zwj","&zwnj;","&#8205;","&#8288;","&#x2060;","&#65279;","&#xfeff;","&#8203;","&#x200b;",",","&#44;","&#003;","&#004;","&#023;","&#031;","&#127;","&#173;","&shy;","&#847;","&#x34f;" ];
+
+	/** @var array $chars */
+	$chars = $special ? $chars . array_merge( $space, $special ) : $space;
+
+	$explode = str_replace($chars, $chars[0], $text);
+	$arr = explode($chars[0], $explode);
+
+	if(count($arr) >= $min) {
+		$arr[count($arr) - 2].= '&nbsp;'.$arr[count($arr) - 1];
+		array_pop($arr);
+		$text = implode(' ',$arr);
+	}
+	return $text;
+}
+
+/**
  * Checks to see if a string is utf8 encoded.
  *
  * NOTE: This function checks for 5-Byte sequences, UTF8
