diff --git a/wp-includes/post.php b/wp-includes/post.php index b1e9df85c2..ca30890169 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2019,43 +2019,47 @@ function get_post_type_labels( $post_type_object ) { * @since 3.0.0 * @access private * - * @param object $object A custom-something object. + * @param object $data_object A custom-something object. * @param array $nohier_vs_hier_defaults Hierarchical vs non-hierarchical default labels. * @return object Object containing labels for the given custom-something object. */ -function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) { - $object->labels = (array) $object->labels; +function _get_custom_object_labels( $data_object, $nohier_vs_hier_defaults ) { + $data_object->labels = (array) $data_object->labels; - if ( isset( $object->label ) && empty( $object->labels['name'] ) ) { - $object->labels['name'] = $object->label; + if ( isset( $data_object->label ) && empty( $data_object->labels['name'] ) ) { + $data_object->labels['name'] = $data_object->label; } - if ( ! isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) { - $object->labels['singular_name'] = $object->labels['name']; + if ( ! isset( $data_object->labels['singular_name'] ) && isset( $data_object->labels['name'] ) ) { + $data_object->labels['singular_name'] = $data_object->labels['name']; } - if ( ! isset( $object->labels['name_admin_bar'] ) ) { - $object->labels['name_admin_bar'] = isset( $object->labels['singular_name'] ) ? $object->labels['singular_name'] : $object->name; + if ( ! isset( $data_object->labels['name_admin_bar'] ) ) { + $data_object->labels['name_admin_bar'] = + isset( $data_object->labels['singular_name'] ) + ? $data_object->labels['singular_name'] + : $data_object->name; } - if ( ! isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) ) { - $object->labels['menu_name'] = $object->labels['name']; + if ( ! isset( $data_object->labels['menu_name'] ) && isset( $data_object->labels['name'] ) ) { + $data_object->labels['menu_name'] = $data_object->labels['name']; } - if ( ! isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) ) { - $object->labels['all_items'] = $object->labels['menu_name']; + if ( ! isset( $data_object->labels['all_items'] ) && isset( $data_object->labels['menu_name'] ) ) { + $data_object->labels['all_items'] = $data_object->labels['menu_name']; } - if ( ! isset( $object->labels['archives'] ) && isset( $object->labels['all_items'] ) ) { - $object->labels['archives'] = $object->labels['all_items']; + if ( ! isset( $data_object->labels['archives'] ) && isset( $data_object->labels['all_items'] ) ) { + $data_object->labels['archives'] = $data_object->labels['all_items']; } $defaults = array(); foreach ( $nohier_vs_hier_defaults as $key => $value ) { - $defaults[ $key ] = $object->hierarchical ? $value[1] : $value[0]; + $defaults[ $key ] = $data_object->hierarchical ? $value[1] : $value[0]; } - $labels = array_merge( $defaults, $object->labels ); - $object->labels = (object) $object->labels; + + $labels = array_merge( $defaults, $data_object->labels ); + $data_object->labels = (object) $data_object->labels; return (object) $labels; } @@ -6323,12 +6327,12 @@ function is_local_attachment( $url ) { * * @param string|array $args Arguments for inserting an attachment. * @param string|false $file Optional. Filename. - * @param int $parent Optional. Parent post ID. + * @param int $parent_post Optional. Parent post ID. * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false. * @param bool $fire_after_hooks Optional. Whether to fire the after insert hooks. Default true. * @return int|WP_Error The attachment ID on success. The value 0 or WP_Error on failure. */ -function wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = false, $fire_after_hooks = true ) { +function wp_insert_attachment( $args, $file = false, $parent_post = 0, $wp_error = false, $fire_after_hooks = true ) { $defaults = array( 'file' => $file, 'post_parent' => 0, @@ -6336,8 +6340,8 @@ function wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = fa $data = wp_parse_args( $args, $defaults ); - if ( ! empty( $parent ) ) { - $data['post_parent'] = $parent; + if ( ! empty( $parent_post ) ) { + $data['post_parent'] = $parent_post; } $data['post_type'] = 'attachment'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 7f33ff0fff..f6a8200126 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-54960'; +$wp_version = '6.2-alpha-54961'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.