Add understrap_edit_post_link() to display the edit post link
This commit is contained in:
parent
2f3860826c
commit
8929d7f6b9
|
|
@ -73,15 +73,7 @@ if ( ! function_exists( 'understrap_entry_footer' ) ) {
|
|||
comments_popup_link( esc_html__( 'Leave a comment', 'understrap' ), esc_html__( '1 Comment', 'understrap' ), esc_html__( '% Comments', 'understrap' ) );
|
||||
echo '</span>';
|
||||
}
|
||||
edit_post_link(
|
||||
sprintf(
|
||||
/* translators: %s: Name of current post */
|
||||
esc_html__( 'Edit %s', 'understrap' ),
|
||||
the_title( '<span class="sr-only">"', '"</span>', false )
|
||||
),
|
||||
'<span class="edit-link">',
|
||||
'</span>'
|
||||
);
|
||||
understrap_edit_post_link();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -157,3 +149,20 @@ if ( ! function_exists( 'understrap_body_attributes' ) ) {
|
|||
echo trim( $attributes ); // phpcs:ignore WordPress.Security.EscapeOutput
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'understrap_edit_post_link' ) ) {
|
||||
/**
|
||||
* Displays the edit post link for post.
|
||||
*/
|
||||
function understrap_edit_post_link() {
|
||||
edit_post_link(
|
||||
sprintf(
|
||||
/* translators: %s: Name of current post */
|
||||
esc_html__( 'Edit %s', 'understrap' ),
|
||||
the_title( '<span class="sr-only">"', '"</span>', false )
|
||||
),
|
||||
'<span class="edit-link">',
|
||||
'</span>'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ defined( 'ABSPATH' ) || exit;
|
|||
|
||||
<footer class="entry-footer">
|
||||
|
||||
<?php edit_post_link( __( 'Edit', 'understrap' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
<?php understrap_edit_post_link(); ?>
|
||||
|
||||
</footer><!-- .entry-footer -->
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue