Avoid an undefined function due to `/wp-admin/includes/dashboard.php` being included too late. props obenland. fixes #27457.

git-svn-id: https://develop.svn.wordpress.org/trunk@27630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2014-03-20 01:30:49 +00:00
parent ae8cea0f82
commit 352e5c61cd
1 changed files with 4 additions and 2 deletions

View File

@ -106,6 +106,10 @@ case 'post-quickdraft-save':
// Check nonce and capabilities
$nonce = $_REQUEST['_wpnonce'];
$error_msg = false;
// For output of the quickdraft dashboard widget
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
if ( ! wp_verify_nonce( $nonce, 'add-post' ) )
$error_msg = __( 'Unable to submit this form, please refresh and try again.' );
@ -122,8 +126,6 @@ case 'post-quickdraft-save':
$_POST['ping_status'] = get_option( 'default_ping_status' );
edit_post();
// output the quickdraft dashboard widget
require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
wp_dashboard_quick_press();
exit;
break;