mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-13 06:07:23 +01:00
Taxonomy: More specific cap check when processing category data on post save.
Ports [37691] to the 4.5 branch. Props dlh. Fixes #36379. Please enter the commit message for your changes. Lines starting Built from https://develop.svn.wordpress.org/branches/4.5@37759 git-svn-id: http://core.svn.wordpress.org/branches/4.5@37724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c75e86705a
commit
4113f3fb69
@ -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;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.5.3-alpha-37757';
|
||||
$wp_version = '4.5.3-alpha-37759';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user