Skip to content

Commit

Permalink
Taxonomy: More specific cap check when processing category data on po…
Browse files Browse the repository at this point in the history
…st 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
  • Loading branch information
boonebgorges committed Jun 14, 2016
1 parent c918c1e commit 6d05c75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions wp-admin/includes/post.php
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -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.
Expand Down

0 comments on commit 6d05c75

Please sign in to comment.