-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from GuyPrimavera/v2.0.1
v2.0.1
- Loading branch information
Showing
4 changed files
with
78 additions
and
96 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,88 @@ | ||
<?php | ||
if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; } | ||
<?php if ( __FILE__ == $_SERVER['SCRIPT_FILENAME'] ) { exit; } | ||
|
||
add_action('init', 'clean_output_buffer'); | ||
function clean_output_buffer() { | ||
ob_start(); | ||
} | ||
|
||
// Custom Logo | ||
|
||
$aquilaOptions = get_option( 'aquila_settings' ); | ||
$aquilaNewLogo = $aquilaOptions['aquila_new_logo']; | ||
$aquilaNewLogoSqr = $aquilaOptions['aquila_new_logo_sqr']; | ||
|
||
if( isset($aquilaOptions['aquila_new_logo']) && $aquilaOptions['aquila_new_logo'] !== "" ) { | ||
|
||
// Admin bar | ||
function aquila_new_logo_admin() { | ||
|
||
$options = get_option( 'aquila_settings' ); | ||
if ( isset ( $options['aquila_new_logo'] ) ) { | ||
$aquilaNewLogo = $options['aquila_new_logo']; | ||
} else { | ||
$aquilaNewLogo = 'none'; | ||
}; | ||
|
||
echo "<style type='text/css'> | ||
#wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before { | ||
display: none!important; | ||
} | ||
#wpadminbar #wp-toolbar li#wp-admin-bar-wp-logo > .ab-item span.ab-icon { | ||
background-image: url('" . $aquilaNewLogo . "')!important; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
margin: 5%!important; | ||
max-width: 90%; | ||
height: 60%; | ||
} | ||
</style>"; | ||
} | ||
|
||
add_action( 'admin_bar_init', 'aquila_new_logo_admin', 82 ); | ||
|
||
// Login screen | ||
function aquila_new_logo_login() { | ||
|
||
$options = get_option( 'aquila_settings' ); | ||
if ( isset ( $options['aquila_new_logo'] ) ) { | ||
$aquilaNewLogo = $options['aquila_new_logo']; | ||
} else { | ||
$aquilaNewLogo = 'none'; | ||
}; | ||
|
||
echo "<style type='text/css'> | ||
body.login #login:before { | ||
display: none!important; | ||
} | ||
body.login #login h1 a { | ||
display: block!important; | ||
} | ||
body.login #login h1 a { | ||
background-image: url('" . $aquilaNewLogo . "')!important; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
width: auto; | ||
height: 80px; | ||
max-width: 350px; | ||
} | ||
</style>"; | ||
} | ||
|
||
add_action( 'login_head', 'aquila_new_logo_login', 82 ); | ||
$GLOBALS['aquilaNewLogo'] = $aquilaNewLogo; | ||
$GLOBALS['aquilaNewLogoSqr'] = $aquilaNewLogoSqr; | ||
|
||
if( isset($aquilaOptions['aquila_new_logo']) && $aquilaOptions['aquila_new_logo'] !== "" ) { | ||
add_action( 'admin_bar_init', 'aquila_new_logo_admin'); | ||
add_action( 'login_head', 'aquila_new_logo_login' ); | ||
} | ||
|
||
// Custom Logo (square) | ||
|
||
if( isset($aquilaOptions['aquila_new_logo_sqr']) && $aquilaOptions['aquila_new_logo_sqr'] !== "" ) { | ||
|
||
function aquila_new_logo_sqr_admin() { | ||
|
||
$options = get_option( 'aquila_settings' ); | ||
if ( isset ( $options['aquila_new_logo_sqr'] ) ) { | ||
$aquilaNewLogoSqr = $options['aquila_new_logo_sqr']; | ||
} else { | ||
$aquilaNewLogoSqr = 'none'; | ||
}; | ||
|
||
echo "<style type='text/css'> | ||
body.folded #wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before { | ||
display: none!important; | ||
} | ||
body.folded #wpadminbar #wp-toolbar li#wp-admin-bar-wp-logo > .ab-item span.ab-icon { | ||
background-image: url('" . $aquilaNewLogoSqr . "')!important; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
margin: 20% 10%!important; | ||
max-width: 80%; | ||
height: 60%; | ||
} | ||
</style>"; | ||
} | ||
|
||
add_action( 'admin_bar_init', 'aquila_new_logo_sqr_admin', 83 ); | ||
|
||
add_action( 'admin_bar_init', 'aquila_new_logo_sqr_admin' ); | ||
} | ||
|
||
// Admin bar | ||
function aquila_new_logo_admin() { | ||
|
||
echo "<style type='text/css'> | ||
#wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before { | ||
display: none!important; | ||
} | ||
#wpadminbar #wp-toolbar li#wp-admin-bar-wp-logo > .ab-item span.ab-icon { | ||
background-image: url('" . $GLOBALS['aquilaNewLogo'] . "')!important; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
margin: 5%!important; | ||
max-width: 90%; | ||
height: 60%; | ||
} | ||
</style>"; | ||
} | ||
|
||
|
||
// Login screen | ||
function aquila_new_logo_login() { | ||
|
||
echo "<style type='text/css'> | ||
body.login #login:before { | ||
display: none!important; | ||
} | ||
body.login #login h1 a { | ||
display: block!important; | ||
} | ||
body.login #login h1 a { | ||
background-image: url('" . $GLOBALS['aquilaNewLogo'] . "')!important; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
width: auto; | ||
height: 80px; | ||
max-width: 350px; | ||
} | ||
</style>"; | ||
} | ||
|
||
function aquila_new_logo_sqr_admin() { | ||
|
||
echo "<style type='text/css'> | ||
body.folded #wpadminbar li#wp-admin-bar-wp-logo > .ab-item .ab-icon:before { | ||
display: none!important; | ||
} | ||
body.folded #wpadminbar #wp-toolbar li#wp-admin-bar-wp-logo > .ab-item span.ab-icon { | ||
background-image: url('" . $GLOBALS['aquilaNewLogoSqr'] . "')!important; | ||
background-size: contain; | ||
background-repeat: no-repeat; | ||
background-position: center center; | ||
margin: 20% 10%!important; | ||
max-width: 80%; | ||
height: 60%; | ||
} | ||
</style>"; | ||
} | ||
|
||
?> |
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
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