mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-08 19:20:03 +00:00
Quick/Bulk Edit: Prevent assigning posts to default categories during bulk edit.
During a bulk edit of posts with different categories, the categories for the edited posts would be reset to the default category: uncategorized by default. This reverts [56712] to resolve the issue. Props peterwilsoncc, hellofromtonya, jorbin. Fixes #59837. See #11302. git-svn-id: https://develop.svn.wordpress.org/trunk@57093 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1147,17 +1147,6 @@ ul.cat-checklist {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
ul.cat-checklist input[name="post_category[]"]:indeterminate::before {
|
||||
content: '';
|
||||
border-top: 2px solid grey;
|
||||
width: 65%;
|
||||
height: 2px;
|
||||
position: absolute;
|
||||
top: calc( 50% + 1px );
|
||||
left: 50%;
|
||||
transform: translate( -50%, -50% );
|
||||
}
|
||||
|
||||
#bulk-titles .ntdelbutton,
|
||||
#bulk-titles .ntdeltitle,
|
||||
.inline-edit-row fieldset ul.cat-checklist label {
|
||||
|
||||
@@ -649,21 +649,8 @@ function bulk_edit_posts( $post_data = null ) {
|
||||
}
|
||||
|
||||
if ( isset( $new_cats ) && in_array( 'category', $tax_names, true ) ) {
|
||||
$cats = (array) wp_get_post_categories( $post_id );
|
||||
|
||||
if (
|
||||
isset( $post_data['indeterminate_post_category'] )
|
||||
&& is_array( $post_data['indeterminate_post_category'] )
|
||||
) {
|
||||
$indeterminate_post_category = $post_data['indeterminate_post_category'];
|
||||
} else {
|
||||
$indeterminate_post_category = array();
|
||||
}
|
||||
|
||||
$indeterminate_cats = array_intersect( $cats, $indeterminate_post_category );
|
||||
$determinate_cats = array_diff( $new_cats, $indeterminate_post_category );
|
||||
$post_data['post_category'] = array_unique( array_merge( $indeterminate_cats, $determinate_cats ) );
|
||||
|
||||
$cats = (array) wp_get_post_categories( $post_id );
|
||||
$post_data['post_category'] = array_unique( array_merge( $cats, $new_cats ) );
|
||||
unset( $post_data['tax_input']['category'] );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user