X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..refs/tags/wordpress-4.0:/wp-admin/includes/meta-boxes.php
diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php
index 7dc45528..3e2c9de6 100644
--- a/wp-admin/includes/meta-boxes.php
+++ b/wp-admin/includes/meta-boxes.php
@@ -9,7 +9,7 @@
*
* @param object $post
*/
-function post_submit_meta_box($post) {
+function post_submit_meta_box($post, $args = array() ) {
global $action;
$post_type = $post->post_type;
@@ -28,11 +28,11 @@ function post_submit_meta_box($post) {
public ) : ?>
@@ -41,23 +41,31 @@ if ( 'publish' == $post->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_link = set_url_scheme( get_permalink( $post->ID ) );
+
+ /**
+ * 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' );
}
?>
-
+
-
+
-
-
+
post_status ) {
@@ -127,7 +135,7 @@ if ( 'private' == $post->post_status ) {
echo esc_html( $visibility_trans ); ?>
-
+
-
+
ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
@@ -173,22 +181,54 @@ 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 ) ) {
@@ -202,25 +242,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' ) ); ?>
+ 'p' ) ); ?>
- '5', 'accesskey' => 'p' ) ); ?>
+ 'p' ) ); ?>
- '5', 'accesskey' => 'p' ) ); ?>
+ 'p' ) ); ?>
-
+
@@ -231,12 +271,89 @@ if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0
+
+
+
+
+
+
+
+
+
+
+
+ %1$s');
+ $date = date_i18n( $datef, strtotime( $post->post_date ) );
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+post_type, 'post-formats' ) ) :
@@ -251,9 +368,9 @@ 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' );
?>
-cap->assign_terms) ) : ?>
+