wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
get_preview_post_link › WordPress Function
Seit4.4.0
Veraltetn/v
› get_preview_post_link ( $post = null, $query_args = array(), $preview_link = '' )
Parameter: (3) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Retrieves the URL used for the post preview.
Allows additional query args to be appended.Ähnliche Funktionen: get_previous_post_link, get_previous_posts_link, get_edit_post_link, get_previous_posts_page_link, get_delete_post_link
Quellcode
function get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) { $post = get_post( $post ); if ( ! $post ) { return; } $post_type_object = get_post_type_object( $post->post_type ); if ( is_post_type_viewable( $post_type_object ) ) { if ( ! $preview_link ) { $preview_link = set_url_scheme( get_permalink( $post ) ); } $query_args['preview'] = 'true'; $preview_link = add_query_arg( $query_args, $preview_link ); } /** * Filters the URL used for a post preview. * * @since 2.0.5 * @since 4.0.0 Added the `$post` parameter. * * @param string $preview_link URL used for the post preview. * @param WP_Post $post Post object. */ return apply_filters( 'preview_post_link', $preview_link, $post ); }