X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/256a3b381f63716209b3527d0a14442ae570c283..899389d1e4043331309c0433543419258b230b60:/wp-admin/includes/meta-boxes.php
diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php
index e77c9ecc..70057534 100644
--- a/wp-admin/includes/meta-boxes.php
+++ b/wp-admin/includes/meta-boxes.php
@@ -42,11 +42,21 @@ if ( 'publish' == $post->post_status ) {
$preview_button = __( 'Preview Changes' );
} else {
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
- $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
+
+ /**
+ * 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' );
}
?>
-
+
@@ -79,7 +89,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">
@@ -125,7 +135,7 @@ if ( 'private' == $post->post_status ) {
echo esc_html( $visibility_trans ); ?>
-
+
@@ -151,16 +161,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');
@@ -185,7 +195,7 @@ if ( ! empty( $args['args']['revisions_count'] ) ) :
printf( __( 'Revisions: %s' ), '
' . number_format_i18n( $args['args']['revisions_count'] ) . '' );
}
?>
-
+
-
+
ID ) ) {
@@ -224,19 +248,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' ) ); ?>
+
-
+
@@ -255,11 +279,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);
?>
@@ -273,8 +292,8 @@ function attachment_submit_meta_box( $post ) {
%1$s');
$date = date_i18n( $datef, strtotime( $post->post_date ) );
?>
@@ -282,7 +301,15 @@ function attachment_submit_meta_box( $post ) {
-
+
@@ -303,7 +330,7 @@ function attachment_submit_meta_box( $post ) {