From 6d05c7521baa980c4efec411feca5e7fab6f307c Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Tue, 14 Jun 2016 01:37:29 +0000 Subject: [PATCH] Taxonomy: More specific cap check when processing category data on post save. Props dlh. Fixes #36379. Built from https://develop.svn.wordpress.org/trunk@37691 git-svn-id: http://core.svn.wordpress.org/trunk@37657 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 7 +++++++ wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 6ef84ba655..bd58325d9a 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -165,6 +165,13 @@ function _wp_translate_postdata( $update = false, $post_data = null ) { $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); } + if ( isset( $post_data['post_category'] ) ) { + $category_object = get_taxonomy( 'category' ); + if ( ! current_user_can( $category_object->cap->assign_terms ) ) { + unset( $post_data['post_category'] ); + } + } + return $post_data; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 932ff17a3d..e7c4a78b10 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-alpha-37690'; +$wp_version = '4.6-alpha-37691'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.