Skip to content

Instantly share code, notes, and snippets.

@philhoyt
Last active December 13, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philhoyt/ab727d2c83b507ed39e8cf425d8f8689 to your computer and use it in GitHub Desktop.
Save philhoyt/ab727d2c83b507ed39e8cf425d8f8689 to your computer and use it in GitHub Desktop.
/**
* Adds a meta box
*/
function simple_meta_box() {
add_meta_box( 'prfx_meta', ( 'View Post' ), 'simple_meta_box_callback', 'staff', 'side', 'high' );
}
add_action( 'add_meta_boxes', 'simple_meta_box' );
/**
* Outputs the content of the meta box
*/
function simple_meta_box_callback( $post ) {
echo '<a href="';
the_permalink();
echo '" class="button button-small" target="_blank">View Profile</a>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment