From 76dda08272eda1840366878761266b46799daebd Mon Sep 17 00:00:00 2001 From: r-a-y Date: Mon, 24 Aug 2015 20:16:06 -0700 Subject: [PATCH] Adminbar: Remove the adminbar on Social Paper pages. Removes the WP adminbar for real this time! Addresses https://github.com/cuny-academic-commons/social-paper/issues/10#issuecomment-125329911. See related commit 125dd06. --- includes/hooks-template.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/includes/hooks-template.php b/includes/hooks-template.php index 323acd3..bd12f04 100755 --- a/includes/hooks-template.php +++ b/includes/hooks-template.php @@ -39,19 +39,6 @@ function cacsp_has_feature_image() { return false; } -/** - * Remove the action which writes inline styles for the admin bar - */ -function cacsp_prevent_inline_admin_bar_styles() { - if ( ! cacsp_is_page() ) { - return; - } - - show_admin_bar( false ); - add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) ); -} -add_action( 'wp', 'cacsp_prevent_inline_admin_bar_styles' ); - /** * Single template loader. * @@ -353,6 +340,22 @@ function _cacsp_archive_ob_end( $q ) { } add_action( 'loop_end', '_cacsp_archive_ob_end', 999 ); +/** + * Disables the admin bar on single Social Paper pages. + * + * Might bring it back later... + * + * @access private + */ +function _cacsp_disable_admin_bar_on_social_paper_pages() { + if ( ! cacsp_is_page() ) { + return; + } + + add_filter( 'show_admin_bar', '__return_false' ); +} +add_action( 'wp', '_cacsp_disable_admin_bar_on_social_paper_pages' ); + /** * Wrap comment content in an identifer div *