X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..refs/tags/wordpress-4.5:/wp-admin/includes/meta-boxes.php diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 7dc45528..bf877c3d 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -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. + * @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) { +function post_submit_meta_box( $post, $args = array() ) { global $action; $post_type = $post->post_type; @@ -28,36 +38,43 @@ function post_submit_meta_box($post) {
post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> -post_status ) { ?>style="display:none" type="submit" name="save" id="save-post" value="" tabindex="4" class="button button-highlighted" /> +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' ); } else { - $preview_link = get_permalink( $post->ID ); - if ( is_ssl() ) - $preview_link = str_replace( 'http://', 'https://', $preview_link ); - $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); $preview_button = __( 'Preview' ); } ?> - +
+
-
+
-
+
post_status ) { @@ -81,11 +98,11 @@ switch ( $post->post_status ) { ?> post_status || 'private' == $post->post_status || $can_publish ) { ?> -post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js" tabindex='4'> +post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js">
- post_status ) : ?> post_status, 'publish' ); ?> value='publish'> post_status ) : ?> @@ -101,13 +118,13 @@ switch ( $post->post_status ) { - +
-
+
-
+
post_status ) { @@ -127,7 +144,7 @@ if ( 'private' == $post->post_status ) { echo esc_html( $visibility_trans ); ?> - +
@@ -137,32 +154,32 @@ echo esc_html( $visibility_trans ); ?> />
-ID ) ); ?> tabindex="4" />
+ID ) ); ?> />
/>
-
+
/>

- +

-
+
ID ) { if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date $stamp = __('Scheduled for: %1$s'); - } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published + } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published $stamp = __('Published on: %1$s'); - } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified + } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified $stamp = __('Publish immediately'); - } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified + } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified $stamp = __('Schedule for: %1$s'); } else { // draft, 1 or more saves, date specified $stamp = __('Publish on: %1$s'); @@ -173,22 +190,49 @@ if ( 0 != $post->ID ) { $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); } +if ( ! empty( $args['args']['revisions_count'] ) ) : ?> +
+ ' . number_format_i18n( $args['args']['revisions_count'] ) . '' ); ?> + +
+ -
+
- -
+ +
+ + +
- +
- +
ID ) ) { @@ -202,25 +246,25 @@ if ( current_user_can( "delete_post", $post->ID ) ) {
- + 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' ) ) : ?> - '5', 'accesskey' => 'p' ) ); ?> + - '5', 'accesskey' => 'p' ) ); ?> + - '5', 'accesskey' => 'p' ) ); ?> + - +
@@ -231,12 +275,89 @@ if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 +
+ +
+ + +
+ +
+ + +
+ %1$s'); + $date = date_i18n( $datef, strtotime( $post->post_date ) ); + ?> +
+ +
+ + +
+
+
+ +
+
+ ID ) ) + if ( EMPTY_TRASH_DAYS && MEDIA_TRASH ) { + echo "" . _x( 'Trash', 'verb' ) . ""; + } else { + $delete_ays = ! MEDIA_TRASH ? " onclick='return showNotice.warn();'" : ''; + echo "" . __( 'Delete Permanently' ) . ""; + } + ?> +
+ +
+ + + +
+
+
+ +
+ +post_type, 'post-formats' ) ) : @@ -251,10 +372,13 @@ function post_format_meta_box( $post, $box ) { $post_formats[0][] = $post_format; ?>
- /> - -
/> -
+
+ + /> + +
/> + +
'post_tag'); - if ( !isset($box['args']) || !is_array($box['args']) ) +function post_tags_meta_box( $post, $box ) { + $defaults = array( 'taxonomy' => 'post_tag' ); + if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { $args = array(); - else + } else { $args = $box['args']; - extract( wp_parse_args($args, $defaults), EXTR_SKIP ); - $tax_name = esc_attr($taxonomy); - $taxonomy = get_taxonomy($taxonomy); - $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : ''; + } + $r = wp_parse_args( $args, $defaults ); + $tax_name = esc_attr( $r['taxonomy'] ); + $taxonomy = get_taxonomy( $r['taxonomy'] ); + $user_can_assign_terms = current_user_can( $taxonomy->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; ?>

-
- cap->assign_terms) ) : ?> + +

+
+
- -
labels->add_new_item; ?>
-

-

+ +

+

-

labels->separate_items_with_commas ); ?>

+

labels->separate_items_with_commas; ?>

-cap->assign_terms) ) : ?> +

labels->choose_from_most_used; ?>

'category'); - if ( !isset($box['args']) || !is_array($box['args']) ) + $defaults = array( 'taxonomy' => 'category' ); + if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) ) { $args = array(); - else + } else { $args = $box['args']; - extract( wp_parse_args($args, $defaults), EXTR_SKIP ); - $tax = get_taxonomy($taxonomy); - + } + $r = wp_parse_args( $args, $defaults ); + $tax_name = esc_attr( $r['taxonomy'] ); + $taxonomy = get_taxonomy( $r['taxonomy'] ); ?> -
-