From 38e6367808c97d5dfc880919bbb2d57eb8f38c9b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 14:42:04 +0000 Subject: [PATCH] Coding Standards: Reformat a condifion for default taxonomy terms in `map_meta_cap()` for better readability. Follow-up to [48356], [48480]. See #43517. Built from https://develop.svn.wordpress.org/trunk@48664 git-svn-id: http://core.svn.wordpress.org/trunk@48426 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/capabilities.php | 5 ++++- wp-includes/post.php | 2 +- wp-includes/taxonomy.php | 2 +- wp-includes/version.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index d2eae061bc..6b6182a030 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -539,7 +539,10 @@ function map_meta_cap( $cap, $user_id, ...$args ) { break; } - if ( 'delete_term' === $cap && ( get_option( 'default_' . $term->taxonomy ) == $term->term_id || get_option( 'default_taxonomy_' . $term->taxonomy ) == $term->term_id ) ) { + if ( 'delete_term' === $cap + && ( get_option( 'default_' . $term->taxonomy ) == $term->term_id + || get_option( 'default_taxonomy_' . $term->taxonomy ) == $term->term_id ) + ) { $caps[] = 'do_not_allow'; break; } diff --git a/wp-includes/post.php b/wp-includes/post.php index d92d9617f2..dfaec48149 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4054,7 +4054,7 @@ function wp_insert_post( $postarr, $wp_error = false ) { $postarr['tax_input'][ $taxonomy ] = array_filter( $postarr['tax_input'][ $taxonomy ] ); } - // Passed custom taxonomy list overwrites existing list if not empty. + // Passed custom taxonomy list overwrites the existing list if not empty. $terms = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) ); if ( ! empty( $terms ) && empty( $postarr['tax_input'][ $taxonomy ] ) ) { $postarr['tax_input'][ $taxonomy ] = $terms; diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 69355a3fb0..d7179fa31b 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -455,7 +455,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { ) ); - // Update term id in options. + // Update `term_id` in options. if ( ! is_wp_error( $term ) ) { update_option( 'default_taxonomy_' . $taxonomy_object->name, $term['term_id'] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 93f5433d19..17aed91a9c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta4-48663'; +$wp_version = '5.5-beta4-48664'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.