From 352e5c61cd1c2687d44fa92b942f92f1ec2e2ffc Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 20 Mar 2014 01:30:49 +0000 Subject: [PATCH] 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 --- src/wp-admin/post.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/post.php b/src/wp-admin/post.php index 3df1c5fc6e..f378c22061 100644 --- a/src/wp-admin/post.php +++ b/src/wp-admin/post.php @@ -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;