diff -r be944660c56a -r 3d72ae0968f4 wp/wp-admin/includes/meta-boxes.php --- a/wp/wp-admin/includes/meta-boxes.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-admin/includes/meta-boxes.php Tue Sep 27 16:37:53 2022 +0200 @@ -87,7 +87,8 @@ endif; /** - * Fires before the post time/date setting in the Publish meta box. + * Fires after the Save Draft (or Save as Pending) and Preview (or Preview Changes) buttons + * in the Publish meta box. * * @since 4.4.0 * @@ -286,7 +287,7 @@ unpublished customization changes. You can edit, but there’s no need to publish now. It will be published automatically with those changes.' ), + __( 'This draft comes from your unpublished customization changes. You can edit, but there is no need to publish now. It will be published automatically with those changes.' ), esc_url( add_query_arg( 'changeset_uuid', @@ -381,11 +382,11 @@ } /** - * Display attachment submit form fields. + * Displays attachment submit form fields. * * @since 3.5.0 * - * @param WP_Post $post + * @param WP_Post $post Current post object. */ function attachment_submit_meta_box( $post ) { ?> @@ -461,11 +462,11 @@ } /** - * Display post format form elements. + * Displays post format form elements. * * @since 3.1.0 * - * @param WP_Post $post Post object. + * @param WP_Post $post Current post object. * @param array $box { * Post formats meta box arguments. * @@ -484,7 +485,7 @@ if ( ! $post_format ) { $post_format = '0'; } - // Add in the current one if it isn't there yet, in case the current theme doesn't support it. + // Add in the current one if it isn't there yet, in case the active theme doesn't support it. if ( $post_format && ! in_array( $post_format, $post_formats[0], true ) ) { $post_formats[0][] = $post_format; } @@ -504,13 +505,13 @@ } /** - * Display post tags form fields. + * Displays post tags form fields. * * @since 2.6.0 * * @todo Create taxonomy-agnostic wrapper for this. * - * @param WP_Post $post Post object. + * @param WP_Post $post Current post object. * @param array $box { * Tags meta box arguments. * @@ -567,13 +568,13 @@ } /** - * Display post categories form fields. + * Displays post categories form fields. * * @since 2.6.0 * * @todo Create taxonomy-agnostic wrapper for this. * - * @param WP_Post $post Post object. + * @param WP_Post $post Current post object. * @param array $box { * Categories meta box arguments. * @@ -691,11 +692,11 @@ } /** - * Display post excerpt form fields. + * Displays post excerpt form fields. * * @since 2.6.0 * - * @param WP_Post $post + * @param WP_Post $post Current post object. */ function post_excerpt_meta_box( $post ) { ?> @@ -713,11 +714,11 @@ } /** - * Display trackback links form fields. + * Displays trackback links form fields. * * @since 2.6.0 * - * @param WP_Post $post + * @param WP_Post $post Current post object. */ function post_trackback_meta_box( $post ) { $form_trackback = 'jQuery(document).ready(function(){commentsBox.get(, 10);}); + post_type ); ?> 'authors', + 'capability' => array( $post_type_object->cap->edit_posts ), 'name' => 'post_author_override', 'selected' => empty( $post->ID ) ? $user_ID : $post->post_author, 'include_selected' => true, @@ -917,11 +920,11 @@ } /** - * Display list of revisions. + * Displays list of revisions. * * @since 2.6.0 * - * @param WP_Post $post + * @param WP_Post $post Current post object. */ function post_revisions_meta_box( $post ) { wp_list_post_revisions( $post ); @@ -932,11 +935,11 @@ // /** - * Display page attributes form fields. + * Displays page attributes form fields. * * @since 2.7.0 * - * @param WP_Post $post + * @param WP_Post $post Current post object. */ function page_attributes_meta_box( $post ) { if ( is_post_type_hierarchical( $post->post_type ) ) : @@ -981,8 +984,8 @@ * * @since 4.4.0 * - * @param string $template The template used for the current post. - * @param WP_Post $post The current post. + * @param string|false $template The template used for the current post. + * @param WP_Post $post The current post. */ do_action( 'page_attributes_meta_box_template', $template, $post ); ?> @@ -1029,11 +1032,11 @@ // /** - * Display link create form fields. + * Displays link create form fields. * * @since 2.7.0 * - * @param object $link + * @param object $link Current link object. */ function link_submit_meta_box( $link ) { ?> @@ -1105,11 +1108,11 @@ } /** - * Display link categories form fields. + * Displays link categories form fields. * * @since 2.6.0 * - * @param object $link + * @param object $link Current link object. */ function link_categories_meta_box( $link ) { ?> @@ -1152,11 +1155,11 @@ } /** - * Display form fields for changing link target. + * Displays form fields for changing link target. * * @since 2.6.0 * - * @param object $link + * @param object $link Current link object. */ function link_target_meta_box( $link ) { @@ -1177,52 +1180,70 @@ } /** - * Display checked checkboxes attribute for xfn microformat options. + * Displays 'checked' checkboxes attribute for XFN microformat options. * * @since 1.0.1 * - * @global object $link + * @global object $link Current link object. * - * @param string $class - * @param string $value - * @param mixed $deprecated Never used. + * @param string $xfn_relationship XFN relationship category. Possible values are: + * 'friendship', 'physical', 'professional', + * 'geographical', 'family', 'romantic', 'identity'. + * @param string $xfn_value Optional. The XFN value to mark as checked + * if it matches the current link's relationship. + * Default empty string. + * @param mixed $deprecated Deprecated. Not used. */ -function xfn_check( $class, $value = '', $deprecated = '' ) { +function xfn_check( $xfn_relationship, $xfn_value = '', $deprecated = '' ) { global $link; if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.5.0' ); // Never implemented. } - $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; - $rels = preg_split( '/\s+/', $link_rel ); + $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: ''; + $link_rels = preg_split( '/\s+/', $link_rel ); - if ( '' !== $value && in_array( $value, $rels, true ) ) { + // Mark the specified value as checked if it matches the current link's relationship. + if ( '' !== $xfn_value && in_array( $xfn_value, $link_rels, true ) ) { echo ' checked="checked"'; } - if ( '' === $value ) { - if ( 'family' === $class && strpos( $link_rel, 'child' ) === false && strpos( $link_rel, 'parent' ) === false && strpos( $link_rel, 'sibling' ) === false && strpos( $link_rel, 'spouse' ) === false && strpos( $link_rel, 'kin' ) === false ) { + if ( '' === $xfn_value ) { + // Mark the 'none' value as checked if the current link does not match the specified relationship. + if ( 'family' === $xfn_relationship + && ! array_intersect( $link_rels, array( 'child', 'parent', 'sibling', 'spouse', 'kin' ) ) + ) { echo ' checked="checked"'; } - if ( 'friendship' === $class && strpos( $link_rel, 'friend' ) === false && strpos( $link_rel, 'acquaintance' ) === false && strpos( $link_rel, 'contact' ) === false ) { + + if ( 'friendship' === $xfn_relationship + && ! array_intersect( $link_rels, array( 'friend', 'acquaintance', 'contact' ) ) + ) { echo ' checked="checked"'; } - if ( 'geographical' === $class && strpos( $link_rel, 'co-resident' ) === false && strpos( $link_rel, 'neighbor' ) === false ) { + + if ( 'geographical' === $xfn_relationship + && ! array_intersect( $link_rels, array( 'co-resident', 'neighbor' ) ) + ) { echo ' checked="checked"'; } - if ( 'identity' === $class && in_array( 'me', $rels, true ) ) { + + // Mark the 'me' value as checked if it matches the current link's relationship. + if ( 'identity' === $xfn_relationship + && in_array( 'me', $link_rels, true ) + ) { echo ' checked="checked"'; } } } /** - * Display xfn form fields. + * Displays XFN form fields. * * @since 2.6.0 * - * @param object $link + * @param object $link Current link object. */ function link_xfn_meta_box( $link ) { ?> @@ -1336,11 +1357,11 @@ } /** - * Display advanced link options form fields. + * Displays advanced link options form fields. * * @since 2.6.0 * - * @param object $link + * @param object $link Current link object. */ function link_advanced_meta_box( $link ) { ?> @@ -1361,12 +1382,12 @@