function get_sample_permalink_html( $post,
$new_title = null,
$new_slug = null
) { $post =
get_post( $post );
if ( !
$post ) { return '';
} list
($permalink,
$post_name) =
get_sample_permalink( $post->ID,
$new_title,
$new_slug );
$view_link = false;
$preview_target = '';
if ( current_user_can( 'read_post',
$post->ID
) ) { if ( 'draft' ===
$post->post_status ||
empty( $post->post_name
) ) { $view_link =
get_preview_post_link( $post );
$preview_target = " target='wp-preview-{
$post->ID
}'";
} else { if ( 'publish' ===
$post->post_status || 'attachment' ===
$post->post_type
) { $view_link =
get_permalink( $post );
}