mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Create a function, get_preview_post_link(), to DRY the logic for applying the 'preview_post_link' filter to a URL.
Props TomHarrigan, wonderboymusic. Fixes #24345. git-svn-id: https://develop.svn.wordpress.org/trunk@34170 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -550,9 +550,8 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||
&& ( $post_type_object->show_in_admin_bar ) )
|
||||
{
|
||||
if ( 'draft' == $post->post_status ) {
|
||||
$preview_link = set_url_scheme( get_permalink( $post->ID ) );
|
||||
/** This filter is documented in wp-admin/includes/meta-boxes.php */
|
||||
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
|
||||
$draft_link = set_url_scheme( get_permalink( $post->ID ) );
|
||||
$preview_link = get_preview_post_link( $post, array(), $draft_link );
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'id' => 'preview',
|
||||
'title' => $post_type_object->labels->view_item,
|
||||
|
||||
Reference in New Issue
Block a user