Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 23297)
+++ wp-includes/general-template.php	(working copy)
@@ -129,6 +129,58 @@
 }
 
 /**
+ * Load a template part from a plugin
+ *
+ * Makes it easy for a plugin to reuse sections of code
+ *
+ * Includes the named template part if a name is specified then a
+ * specialised part will be included. If the plugin contains no {slug}.php file
+ * then no template will be included.
+ *
+ * The template is included using require, unless require_once is specified, so you may include the
+ * same template part multiple times.
+ *
+ * For the $name parameter, if the file is called "{slug}-special.php" then specify
+ * "special".
+ *
+ * @since 3.6.0
+ * @uses do_action() Calls 'get_plugin_part_{$slug}' action.
+ *
+ * @param string $plugin The slug name for the plugin
+ * @param string $slug The slug name for the generic template.
+ * @param string $name The name of the specialised template.
+ * @param bool $require_once Whether to require_once or require. Default true.
+ */
+function get_plugin_part( $plugin, $slug, $name = null, $require_once = false ) {
+	do_action( "get_plugin_part_{$slug}", $slug, $name );
+
+	$templates = array();
+	if ( ! empty( $name ) )
+		$templates[] = "{$plugin}/{$slug}-{$name}.php";
+
+	$templates[] = "{$plugin}/{$slug}.php";
+
+	$located = '';
+	foreach ( (array) $templates as $template_name ) {
+		if ( ! $template_name )
+			continue;
+		if ( file_exists( WP_PLUGIN_DIR . '/' . $template_name ) ) {
+			$located = WP_PLUGIN_DIR . '/' . $template_name;
+			break;
+		}
+	}
+
+	if ( '' != $located ) {
+		if ( $require_once )
+			require_once( $located );
+		else
+			require( $located );
+	}
+
+	return $located;
+}
+
+/**
  * Display search form.
  *
  * Will first attempt to locate the searchform.php file in either the child or
