wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
edit_post_link › WordPress Function
Seit1.0.0
Veraltetn/v
› edit_post_link ( $text = null, $before = '', $after = '', $post = 0, $css_class = 'post-edit-link' )
Parameter: (5) |
|
Definiert in: |
|
Codex: | |
Changelog: |
|
Displays the edit post link for post.
Ähnliche Funktionen: get_edit_post_link, next_post_link, next_posts_link, edit_tag_link, edit_term_link
Quellcode
function edit_post_link( $text = null, $before = '', $after = '', $post = 0, $css_class = 'post-edit-link' ) { $post = get_post( $post ); if ( ! $post ) { return; } $url = get_edit_post_link( $post->ID ); if ( ! $url ) { return; } if ( null === $text ) { $text = __( 'Edit This' ); } $link = '<a class="' . esc_attr( $css_class ) . '" href="' . esc_url( $url ) . '">' . $text . '</a>'; /** * Filters the post edit link anchor tag. * * @since 2.3.0 * * @param string $link Anchor tag for the edit link. * @param int $post_id Post ID. * @param string $text Anchor text. */ echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after; }