Skip to content

Commit

Permalink
Adminbar: Remove the adminbar on Social Paper pages.
Browse files Browse the repository at this point in the history
Removes the WP adminbar for real this time!

Addresses #10 (comment).

See related commit 125dd06.
  • Loading branch information
r-a-y committed Aug 25, 2015
1 parent 6ed510e commit 76dda08
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions includes/hooks-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 76dda08

Please sign in to comment.