Skip to content

Instantly share code, notes, and snippets.

@lawrencebrown
Created April 8, 2020 06:32
Show Gist options
  • Save lawrencebrown/f204dc5ce1a8b8045c1fa9f7e1d529f7 to your computer and use it in GitHub Desktop.
Save lawrencebrown/f204dc5ce1a8b8045c1fa9f7e1d529f7 to your computer and use it in GitHub Desktop.
Used at the bottom of posts for logged in users to edit
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'larryworld' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
),
'<span class="edit-link">',
'</span>'
);
?>
</footer><!-- .entry-footer -->
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment