wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
edit_post_link › WordPress Function
Od1.0.0
Przestarzałyn/a
› edit_post_link ( $text = null, $before = '', $after = '', $post = 0, $css_class = 'post-edit-link' )
Parametry: (5) |
|
Zdefiniowane na: |
|
Codex: | |
Dziennik zmian: |
|
Displays the edit post link for post.
Powiązane Funkcje: get_edit_post_link, next_post_link, next_posts_link, edit_tag_link, edit_term_link
Źródło
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; }