From 593bd2a495f09da6897f1790f0d0ea12e8946701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Thu, 20 Mar 2014 01:31:15 +0000 Subject: [PATCH] Avoid an undefined function due to `/wp-admin/includes/dashboard.php` being included too late. props obenland. fixes #27457. Built from https://develop.svn.wordpress.org/trunk@27630 git-svn-id: http://core.svn.wordpress.org/trunk@27473 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/post.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/post.php b/wp-admin/post.php index 3df1c5fc6e..f378c22061 100644 --- a/wp-admin/post.php +++ b/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;