X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/6c8f14c09105d0afa4c1574215c59b5021040e76..88550bc3400cc7c035ff590ecb007c7938041ded:/wp-admin/includes/meta-boxes.php diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 2b0b2864..c7307d52 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; @@ -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' ); } ?> - + @@ -55,7 +65,7 @@ if ( 'publish' == $post->post_status ) {