You appear to be a bot. Output may be restricted
Description
Filters the edit post link to add an icon and use the post meta structure.
Usage
twentytwenty_edit_post_link( $link, $post_id, $text );
Parameters
- $link
- ( string ) required – Anchor tag for the edit link.
- $post_id
- ( int ) required – Post ID.
- $text
- ( string ) required – Anchor text.
Returns
void
Source
File name: twentytwenty/inc/template-tags.php
Lines:
1 to 27 of 27
function twentytwenty_edit_post_link( $link, $post_id, $text ) { if ( is_admin() ) { return $link; } $edit_url = get_edit_post_link( $post_id ); if ( ! $edit_url ) { return; } $text = sprintf( wp_kses( /* translators: %s: Post title. Only visible to screen readers. */ __( 'Edit <span class="screen-reader-text">%s</span>', 'twentytwenty' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title( $post_id ) ); return '<div class="post-meta-wrapper post-meta-edit-link-wrapper"><ul class="post-meta"><li class="post-edit meta-wrapper"><span class="meta-icon">' . twentytwenty_get_theme_svg( 'edit' ) . '</span><span class="meta-text"><a href="' . esc_url( $edit_url ) . '">' . $text . '</a></span></li></ul><!-- .post-meta --></div><!-- .post-meta-wrapper -->'; }