diff -r 490d5cc509ed -r cf61fcea0001 wp/wp-admin/includes/meta-boxes.php --- a/wp/wp-admin/includes/meta-boxes.php Tue Jun 09 11:14:17 2015 +0000 +++ b/wp/wp-admin/includes/meta-boxes.php Mon Oct 14 17:39:30 2019 +0200 @@ -3,13 +3,23 @@ // -- Post related Meta Boxes /** - * Display post submit form fields. + * Displays post submit form fields. * * @since 2.7.0 * - * @param object $post + * @global string $action + * + * @param WP_Post $post Current post object. + * @param array $args { + * Array of arguments for building the post submit meta box. + * + * @type string $id Meta box 'id' attribute. + * @type string $title Meta box title. + * @type callable $callback Meta box display callback. + * @type array $args Extra meta box arguments. + * } */ -function post_submit_meta_box($post, $args = array() ) { +function post_submit_meta_box( $post, $args = array() ) { global $action; $post_type = $post->post_type; @@ -22,52 +32,57 @@
- +
post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> post_status ) { ?>style="display:none" type="submit" name="save" id="save-post" value="" class="button" /> + post_status && $can_publish ) { ?> + -
-public ) : ?> +
post_status ) { - $preview_link = esc_url( get_permalink( $post->ID ) ); - $preview_button = __( 'Preview Changes' ); + $preview_button_text = __( 'Preview Changes' ); } else { - $preview_link = set_url_scheme( get_permalink( $post->ID ) ); + $preview_button_text = __( 'Preview' ); +} - /** - * Filter the URI of a post preview in the post submit box. - * - * @since 2.0.5 - * @since 4.0.0 $post parameter was added. - * - * @param string $preview_link URI the user will be directed to for a post preview. - * @param WP_Post $post Post object. - */ - $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ) ); - $preview_button = __( 'Preview' ); -} +$preview_button = sprintf( '%1$s %2$s', + $preview_button_text, + /* translators: accessibility text */ + __( '(opens in a new window)' ) +); ?>
+
-
- - + post_status ) { case 'private': _e('Privately Published'); @@ -89,11 +104,12 @@ ?> post_status || 'private' == $post->post_status || $can_publish ) { ?> -post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js"> +post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" role="button">
- post_status ) : ?> post_status, 'publish' ); ?> value='publish'> post_status ) : ?> @@ -135,7 +151,7 @@ echo esc_html( $visibility_trans ); ?> - +
@@ -148,7 +164,7 @@ ID ) ); ?> />
/>
-
+
/>

@@ -161,18 +177,22 @@

ID ) { if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date + /* translators: Post date information. 1: Date on which the post is currently scheduled to be published */ $stamp = __('Scheduled for: %1$s'); } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published + /* translators: Post date information. 1: Date on which the post was published */ $stamp = __('Published on: %1$s'); } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified $stamp = __('Publish immediately'); } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified + /* translators: Post date information. 1: Date on which the post is to be published */ $stamp = __('Schedule for: %1$s'); } else { // draft, 1 or more saves, date specified + /* translators: Post date information. 1: Date on which the post is to be published */ $stamp = __('Publish on: %1$s'); } $date = date_i18n( $datef, strtotime( $post->post_date ) ); @@ -181,20 +201,12 @@ $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); } -if ( ! empty( $args['args']['revisions_count'] ) ) : - $revisions_to_keep = wp_revisions_to_keep( $post ); -?> +if ( ! empty( $args['args']['revisions_count'] ) ) : ?>
- 0 && $revisions_to_keep <= $args['args']['revisions_count'] ) { - echo ''; - printf( __( 'Revisions: %s' ), '' . number_format_i18n( $args['args']['revisions_count'] ) . '+' ); - echo ''; - } else { + ' . number_format_i18n( $args['args']['revisions_count'] ) . '' ); - } -?> + ?>
- -
+ +
+ + +
+post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?> +
+

+ unpublished customization changes. You can edit, but there’s no need to publish now. It will be published automatically with those changes.' ), + esc_url( + add_query_arg( + 'changeset_uuid', + rawurlencode( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ), + admin_url( 'customize.php' ) + ) + ) + ); + ?> +

+
+ +
@@ -226,8 +264,12 @@ * Fires at the beginning of the publishing actions section of the Publish meta box. * * @since 2.7.0 + * @since 4.9.0 Added the `$post` parameter. + * + * @param WP_Post|null $post WP_Post object for the current post on Edit Post screen, + * null on Edit Link screen. */ -do_action( 'post_submitbox_start' ); +do_action( 'post_submitbox_start', $post ); ?>
post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { if ( $can_publish ) : if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> - - + + - + - + @@ -286,19 +328,24 @@
- +
- %1$s'); - $date = date_i18n( $datef, strtotime( $post->post_date ) ); - ?>
- + post_date ) + ); + printf( + /* translators: Attachment information. %s: Date the attachment was uploaded */ + __( 'Uploaded on: %s' ), + '' . $date . '' + ); + ?>
@@ -319,7 +369,7 @@ ID ) ) if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { - echo "" . __( 'Trash' ) . ""; + echo "" . _x( 'Trash', 'verb' ) . ""; } else { $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; echo "" . __( 'Delete Permanently' ) . ""; @@ -330,7 +380,7 @@
- +
@@ -349,9 +399,9 @@ * @param array $box { * Post formats meta box arguments. * - * @type string $id Meta box ID. + * @type string $id Meta box 'id' attribute. * @type string $title Meta box title. - * @type callback $callback Meta box display callback. + * @type callable $callback Meta box display callback. * @type array $args Extra meta box arguments. * } */ @@ -368,10 +418,13 @@ $post_formats[0][] = $post_format; ?>
- /> - -
/> -
+
+ + /> + +
/> + +
cap->assign_terms ); $comma = _x( ',', 'tag delimiter' ); + $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name ); + if ( ! is_string( $terms_to_edit ) ) { + $terms_to_edit = ''; + } ?>
-

labels->add_or_remove_items; ?>

-
+ +

+
- -

+ +

-

labels->separate_items_with_commas; ?>

+

labels->separate_items_with_commas; ?>

+ +

labels->no_terms; ?>

-
+
-

labels->choose_from_most_used; ?>

+

" class="categorydiv">