The Genesis Framework bundles a number of useful shortcodes that allow you to access and output important pieces of information quickly. One of these produces a clickable link to the editing area for a Post or Page that you can see but your audience can’t.
The shortcode to produce a clickable edit link that you can only see when logged in is
This shortcode is employed by default in the entry meta, but you can actually use it wherever you like, such as the Post or Page title, the Post or Page body or the entry meta after the content.
As an example, below is the code to display the private edit link after the content instead of before the content.
You can use the
attribute to change the clickable text of the edit link.
before – Text to insert immediately before the clickable edit link.
after – Text to insert immediately after the clickable edit link.
link – The clickable text of the edit link.
[post_edit] outputs the following in order:
- the text passed to the before attribute, if any
<a class="post-edit-link" href="#">, where
#is the link to the editing area
- the main text, depending on the link attribute
- the text passed to the after attribute, if any
There are two filters on the output of this shortcode.
genesis_edit_post_linkfilter can be used to short circuit the shortcode and disable all edit links.
- The entire marked up edit link passes through the
genesis_post_edit_shortcodefilter before being output.
Genesis Simple Edits
[post_edit] has been included since version 1.1.0.
[post_edit] is located in lib/shortcodes/post.php.