$page); add_meta_box( 'authorsure-author-box-visibility', 'AuthorSure Settings', array( AUTHORSURE_POST, 'author_box_visibility_panel' ), $page, 'advanced', 'low' ,$vars); global $current_screen; if (method_exists($current_screen,'add_help_tab')) { $current_screen->add_help_tab( array( 'id' => 'authorsure_help_tab', 'title' => __('AuthorSure Settings'), 'content' => __( '
In the AuthorSure Settings section below you can choose whether to show or hide the author box for this page. You might want to hide the author box on contact, privacy statement and terms and conditions pages.
')) ); } } } static function author_box_visibility_panel($post,$metabox) { $page_or_post = $metabox['args']['page_or_post']; global $post; $showtime = ('page' === $page_or_post) && AUTHORSURE::get_option('hide_box_on_pages') ; $key = $showtime ? AUTHORSURE::get_show_author_box_key() : AUTHORSURE::get_hide_author_box_key(); $toggle = get_post_meta($post->ID, $key, true); $author_box_toggle = $toggle?' checked="checked"':''; $action = $showtime ? 'show' : 'hide'; $label = __($showtime ? 'show the author box on this page' : 'hide the author box on this page'); print <<< AUTHORSURE_VISIBILITY AUTHORSURE_VISIBILITY; } static function save($post_id) { if (array_key_exists('authorsure_toggle_action', $_POST)) { $key = 'show'==$_POST['authorsure_toggle_action'] ? AUTHORSURE::get_show_author_box_key() : AUTHORSURE::get_hide_author_box_key(); $val = array_key_exists($key, $_POST) ? $_POST[$key] : false; update_post_meta( $post_id, $key, $val ); } } } ?>