Skip to content

Instantly share code, notes, and snippets.

@Pleiades
Created November 15, 2012 22:01
Show Gist options
  • Save Pleiades/4081620 to your computer and use it in GitHub Desktop.
Save Pleiades/4081620 to your computer and use it in GitHub Desktop.
Add Private Notes to Posts
function sc_note( $atts, $content = null ) {
if ( current_user_can( 'publish_posts' ) )
return '<div class="note">'.$content.'</div>';
return '';
}
add_shortcode( 'note', 'sc_note' );
[note]<em>Your note text</em>[/note]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment