diff --git a/wp-includes/post.php b/wp-includes/post.php
index d8236bf068..48ab0c3a47 100644
--- a/wp-includes/post.php
+++ b/wp-includes/post.php
@@ -4771,3 +4771,147 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
return $post;
}
+
+/**
+ * Returns or echos a form containing a post box.
+ *
+ * Used for the QuickPress dashboard module.
+ *
+ * @since 3.1.0
+ *
+ * @param array $args Arguments.
+ * @param string $post_type Post type.
+ */
+function wp_quickpress_form( $args = array(), $post_type = 'post'){
+ global $post_ID;
+
+ $fields = array(
+ 'title' => array(
+ 'capability' => '', // Capability to check before outputing field
+ 'output' => '
+
+
+
'
+ ),
+ 'media_buttons' => array(
+ 'capability' => 'upload_files',
+ 'output' => ''. get_media_buttons() .'
',
+ ),
+ 'content' => array(
+ 'capability' => '',
+ 'output' => '
+
+
+
+ '."
+ "
+
+ ),
+ 'tags' => array(
+ 'capability' =>'',
+ 'output' => '
+
+
+
+
+'
+ ),
+
+ );
+
+ $hidden_fields = array(
+ 'action' => '',
+ 'post_id' => '',
+ 'post_type' => '',
+ );
+
+ $submit_fields = array(
+ 'save' => '',
+ 'reset' => '',
+ );
+
+ $publishing_action = current_user_can('publish_posts') ? esc_attr('Publish') : esc_attr('Submit for Review');
+
+ $publishing_fields = array(
+ 'submit' => '',
+ /*'test' => '', */
+
+ );
+
+ $defaults = array(
+ 'action' => admin_url( 'post.php' ),
+ 'fields' => $fields,
+ 'form_id' => '',
+ 'default_cap' => 'edit_posts',
+ 'tabindex_start' => '1',
+ 'ajax' => true,
+ 'hidden_fields' => $hidden_fields,
+ 'submit_fields' => $submit_fields,
+ 'publishing_fields' => $publishing_fields,
+ 'submit_class' => 'submit',
+ 'publish_action_container' => 'span',
+ 'publish_action_id' => 'publishing-action',
+ 'hidden_and_submit_fields_container' => 'p',
+ 'hidden_and_submit_fields_container_class' => 'submit',
+ );
+
+ $args = wp_parse_args($args, $defaults);
+
+ $tabindex = apply_filters( 'quickpress_tabindex_start', $args['tabindex_start'], $args['form_id'] );
+
+ if ( current_user_can( $args['default_cap'] ) ): ?>
+
+ ';
+ do_action('quickpress_form_after_form', $args['form_id'] );
+ else:
+ do_action( 'quickpress_form_no_form', $args['form_id'] );
+ endif;
+}
+
+?>
\ No newline at end of file