Index: wp-includes/pluggable.php
===================================================================
--- wp-includes/pluggable.php	(revision 31600)
+++ wp-includes/pluggable.php	(working copy)
@@ -570,8 +570,9 @@
 		 * @since 2.5.0
 		 *
 		 * @param string $username User login.
+		 * @param WP_Error $user The WP_Error object
 		 */
-		do_action( 'wp_login_failed', $username );
+		do_action( 'wp_login_failed', $username, $user );
 	}
 
 	return $user;
@@ -1504,8 +1505,10 @@
 	 *
 	 * @param string $message_headers Headers for the comment notification email.
 	 * @param int    $comment_id      Comment ID.
+	 * @param int    $post_id         Post ID.
+	 * @param int    $blog_id         Blog ID.
 	 */
-	$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment_id );
+	$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment_id, $post->ID, get_current_blog_id() );
 
 	foreach ( $emails as $email ) {
 		@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 31600)
+++ wp-includes/media.php	(working copy)
@@ -1017,6 +1017,16 @@
 		return '';
 	}
 
+	/**
+	 * Filter the post gallery attachments, to allow custom sorting not possible in the get_children() query.
+	 *
+	 * @since 4.2
+	 *
+	 * @param array   $attachments  The list of attachments, an array of objects
+	 * @param string  $attr         Attributes to the shortcode
+	 */
+	$attachments = apply_filters( 'post_gallery_attachments', $attachments, $attr );
+
 	if ( is_feed() ) {
 		$output = "\n";
 		foreach ( $attachments as $att_id => $attachment ) {
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 31600)
+++ wp-includes/functions.php	(working copy)
@@ -527,6 +527,16 @@
 		}
 	}
 
+	/**
+	 * Filter the list of enclosure links to check.
+	 *
+	 * @since 4.2
+	 *
+	 * @param array        $post_links  The array of links.
+	 * @param int          $post_ID  Post ID.
+	 */
+	$post_links = apply_filters( 'do_enclose_links', $post_links, $post_ID );
+
 	foreach ( (array) $post_links as $url ) {
 		if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $url ) . '%' ) ) ) {
 
@@ -1791,6 +1801,23 @@
 		}
 	}
 
+	/**
+	 * Filter the upload basedir.
+	 *
+	 * @since 4.2
+	 *
+	 * @param string       $dir The base directory.
+	 */
+	$dir = apply_filters( 'upload_basedir', $dir );
+	/**
+	 * Filter the upload base URL.
+	 *
+	 * @since 4.2
+	 *
+	 * @param string       $url The base URL.
+	 */
+	$url = apply_filters( 'upload_baseurl', $url );
+
 	$basedir = $dir;
 	$baseurl = $url;
 
Index: wp-admin/upload.php
===================================================================
--- wp-admin/upload.php	(revision 31600)
+++ wp-admin/upload.php	(working copy)
@@ -82,6 +82,14 @@
 		<div class="error hide-if-js">
 			<p><?php _e( 'The grid view for the Media Library requires JavaScript. <a href="upload.php?mode=list">Switch to the list view</a>.' ); ?></p>
 		</div>
+		<?php 
+		/**
+		 * Fires when the media grid view is rendered.
+		 *
+		 * @since 4.2
+		 */
+		do_action( 'media-library-ui' );
+		?>
 	</div>
 	<?php
 	include( ABSPATH . 'wp-admin/admin-footer.php' );
@@ -262,7 +270,14 @@
 
 if ( !empty($message) ) { ?>
 <div id="message" class="updated"><p><?php echo $message; ?></p></div>
-<?php } ?>
+<?php }
+/**
+ * Fires when the media grid view is rendered.
+ *
+ * @since 4.2
+ */
+do_action('media-library-ui'); // WPCOM
+?>
 
 <form id="posts-filter" method="get">
 
Index: wp-admin/revision.php
===================================================================
--- wp-admin/revision.php	(revision 31600)
+++ wp-admin/revision.php	(working copy)
@@ -86,6 +86,15 @@
 if ( ! $redirect && empty( $post->post_type ) )
 	$redirect = 'edit.php';
 
+/**
+ * Filter the revision redirect URL.
+ *
+ * @since 4.2.0
+ *
+ * @param string       $redirect The destination URL.
+ */
+$redirect = apply_filters('revision_redirect', $redirect);
+
 if ( ! empty( $redirect ) ) {
 	wp_redirect( $redirect );
 	exit;
Index: wp-admin/includes/update.php
===================================================================
--- wp-admin/includes/update.php	(revision 31600)
+++ wp-admin/includes/update.php	(working copy)
@@ -222,7 +222,7 @@
 	}
 
 	$msg = sprintf( __( 'WordPress %1$s running %2$s theme.' ), get_bloginfo( 'version', 'display' ), $theme_name );
-
+	
 	if ( current_user_can('update_core') ) {
 		$cur = get_preferred_from_update_core();
 
@@ -230,6 +230,16 @@
 			$msg .= " <a href='" . network_admin_url( 'update-core.php' ) . "' class='button'>" . sprintf( __('Update to %s'), $cur->current ? $cur->current : __( 'Latest' ) ) . '</a>';
 	}
 
+	/**
+	 * Filter the update right now message.
+	 *
+	 * @since 4.2
+	 *
+	 * @param string $msg         Complete message string.
+	 * @param string $theme_name  Theme name.
+	 */
+	$msg = apply_filters( 'update_right_now_message', $msg, $theme_name );
+
 	echo "<p id='wp-version-message'>$msg</p>";
 }
 
Index: wp-admin/includes/ajax-actions.php
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 31600)
+++ wp-admin/includes/ajax-actions.php	(working copy)
@@ -1815,12 +1815,29 @@
 	if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) {
 		$sidebars[$sidebar_id] = $sidebar;
 		wp_set_sidebars_widgets($sidebars);
+		/**
+		 * Fires after a widget is deleted.
+		 *
+		 * @since 4.2
+		 *
+		 * @param $id_base    Base ID of the removed widget.
+		 */
+		do_action( 'widget_removed', $id_base );
 		echo "deleted:$widget_id";
 		wp_die();
 	}
 
-	if ( !empty($_POST['add_new']) )
+	if ( !empty($_POST['add_new']) ) {
+		/**
+		 * Fires after a widget is added.
+		 *
+		 * @since 4.2
+		 *
+		 * @param $id_base    Base ID of the removed widget.
+		 */
+		do_action( 'widget_added', $id_base );
 		wp_die();
+	}
 
 	if ( $form = $wp_registered_widget_controls[$widget_id] )
 		call_user_func_array( $form['callback'], $form['params'] );
