Created
November 18, 2016 17:20
-
-
Save kerelist/f8aff73c1da5ab9919447e44f990adfd to your computer and use it in GitHub Desktop.
Add a custom widget box on the sidebar of chosen page or post types to provide instructions to the content editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'add_meta_boxes', 'add_side_instructions_box' ); | |
function add_side_instructions_box() { | |
foreach( array( 'custom_post_type', 'page' ) as $customPages ) { //list which posts you would like this to appear on | |
add_meta_box( | |
'project_side_instructions', //meta box id | |
__( 'Helpful Hints', 'site_domain' ), //meta box title | |
'inner_side_instructions_box', //callback to function with box content | |
$customPages, //which pages the box appears on | |
'side', //area of page where the box appears | |
'low' //box priority on page | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment