post_status ) {
@@ -79,7 +98,7 @@ 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">
+
post_status ) { ?>style="display:none;" class="edit-post-status hide-if-no-js">
@@ -99,13 +118,13 @@ switch ( $post->post_status ) {
-
+
+
post_status ) {
@@ -125,7 +144,7 @@ if ( 'private' == $post->post_status ) {
echo esc_html( $visibility_trans ); ?>
-
+
@@ -151,16 +170,16 @@ echo esc_html( $visibility_trans ); ?>
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 ');
@@ -171,22 +190,60 @@ if ( 0 != $post->ID ) {
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
}
+if ( ! empty( $args['args']['revisions_count'] ) ) :
+ $revisions_to_keep = wp_revisions_to_keep( $post );
+?>
+
+ 0 && $revisions_to_keep <= $args['args']['revisions_count'] ) {
+ echo '
';
+ printf( __( 'Revisions: %s' ), '' . number_format_i18n( $args['args']['revisions_count'] ) . '+ ' );
+ echo ' ';
+ } else {
+ printf( __( 'Revisions: %s' ), '
' . number_format_i18n( $args['args']['revisions_count'] ) . ' ' );
+ }
+?>
+
+
+
-
-
+
ID ) ) {
@@ -206,19 +263,19 @@ if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0
if ( $can_publish ) :
if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
- 'p' ) ); ?>
+
- 'p' ) ); ?>
+
- 'p' ) ); ?>
+
-
+
@@ -237,11 +294,6 @@ if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0
* @param object $post
*/
function attachment_submit_meta_box( $post ) {
- global $action;
-
- $post_type = $post->post_type;
- $post_type_object = get_post_type_object($post_type);
- $can_publish = current_user_can($post_type_object->cap->publish_posts);
?>
@@ -255,16 +307,24 @@ function attachment_submit_meta_box( $post ) {
%1$s');
$date = date_i18n( $datef, strtotime( $post->post_date ) );
?>
-
@@ -285,7 +345,7 @@ function attachment_submit_meta_box( $post ) {
-
+
@@ -300,7 +360,15 @@ function attachment_submit_meta_box( $post ) {
*
* @since 3.1.0
*
- * @param object $post
+ * @param WP_Post $post Post object.
+ * @param array $box {
+ * Post formats meta box arguments.
+ *
+ * @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_format_meta_box( $post, $box ) {
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) ) :
@@ -315,10 +383,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 = '';
+ }
?>
'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'] );
?>
-