Skip to content

Instantly share code, notes, and snippets.

@bob-moore
Created March 21, 2022 16:59
Show Gist options
  • Save bob-moore/ed124c73a2731411a295b12c270a0262 to your computer and use it in GitHub Desktop.
Save bob-moore/ed124c73a2731411a295b12c270a0262 to your computer and use it in GitHub Desktop.
Quick plugin to disable astra transparent header on login page
<?php
/**
* @wordpress-plugin
* Plugin Name: CUSTOM PLUGIN NAME
* Plugin URI: https://YOURDOMAIN.com
* Description: CUSTOM PLUGIN DESCRIPTION
* Version: 1.0.0
* Author: YOUR NAME
* Author URI: https://YOURDOMAIN.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: custom_plugin_name
*/
/**
* Checks if on login page, and disables astra transparent header
*
* @param bool $enabled : Whether the transparent header is enabled
* @return bool $enabled : Maybe modified $enabled boolean
* @since 1.0.0
*/
function custom_plugin_name_disable_transparent_header( $enabled ) {
if ( is_page( 'login' ) ) {
$enabled = false;
}
return $enabled;
}
add_filter( 'astra_is_transparent_header', 'custom_plugin_name_disable_transparent_header' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment