' . __( 'Upload logo and hide/show wordpress default stuffs.', "ae-admin-customizer" ) . '
';
}
/**
* Admin Dashboard Logo Settings Render
* @Since : 1.0.0
*/
public static function ae_admin_dashboard_logo_callback(){
$options = get_option( 'ae_admin_customizer_options' );
if( self::ae_has_custom_logo() ){
$admin_logo = $options['ae_admin_dashboard_logo'];
}else{
$admin_logo = plugins_url('/assets/image/no-image.png', AE_ADMIN_CUSTOMIZER_PLUGIN__FILE__ );
}
echo "
";
echo "";
printf(
'',
isset( $options['ae_admin_dashboard_logo'] ) ? esc_attr( $options['ae_admin_dashboard_logo']) : ''
);
}
/*
Disable Quicklinks Dropdown on Toolbar Logo
*/
public static function ae_admin_remove_quicklinks_menu_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_quicklinks_menu'] ) && $options['ae_admin_remove_quicklinks_menu'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove WP Version in Admin Footer
*/
public static function ae_admin_remove_wpversion_footer_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_wpversion_footer'] ) && $options['ae_admin_remove_wpversion_footer'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove Version From Scripts and Stylesheets
*/
public static function ae_admin_remove_version_scripts_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_version_scripts'] ) && $options['ae_admin_remove_version_scripts'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove WP Generator Tag
*/
public static function ae_admin_remove_wp_generator_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_wp_generator'] ) && $options['ae_admin_remove_wp_generator'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove Help Tab
*/
public static function ae_admin_remove_help_tab_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_help_tab'] ) && $options['ae_admin_remove_help_tab'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove Screen Option Tab
*/
public static function ae_admin_remove_screen_option_tab_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_screen_option_tab'] ) && $options['ae_admin_remove_screen_option_tab'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove WP Welcome Widget
*/
public static function ae_admin_remove_welcome_widget_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$checked = isset( $options['ae_admin_remove_welcome_widget'] ) && $options['ae_admin_remove_welcome_widget'] == 1 ? 'checked' : '';
echo "";
}
/*
Remove WP News Widget
*/
public static function ae_admin_remove_news_widget_callback(){
$options = get_option( 'ae_admin_customizer_options' );
$temp = $options['ae_admin_remove_news_widget'];
$checked = isset( $options['ae_admin_remove_news_widget'] ) && $options['ae_admin_remove_news_widget'] == 1 ? 'checked' : '';
?>
>
',
isset( $options['ae_admin_footer_text'] ) ? esc_attr( $options['ae_admin_footer_text']) : ''
);
}
/*
Add Parent Topbar to include the logo
*/
public static function ae_add_logo_topbar($wp_admin_bar){
$options = get_option( 'ae_admin_customizer_options' );
if( self::ae_has_custom_logo() )
{
$args = array(
'id' => 'ae-topbar-logo',
'title' => '
',
'href' => admin_url("index.php"),
'meta' => array( 'class' => 'ae-admin-topbar-logo' )
);
//remove wp logo
add_action('admin_bar_menu', array(__CLASS__, 'remove_wp_logo_topbar'), 99999 );
//add the new logo node
$wp_admin_bar->add_node( $args );
}
}
public static function remove_wp_logo_topbar($wp_admin_bar){
$wp_admin_bar->remove_node("wp-logo");
}
//Checks if logo has been set
public static function ae_has_custom_logo(){
$options = get_option( 'ae_admin_customizer_options' );
if( isset( $options['ae_admin_dashboard_logo'] ) && !empty($options['ae_admin_dashboard_logo']) )
{
return true;
}else{
return false;
}
}
/* Footer Version */
public static function ae_implement_remove_wp_footer_version($ver){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_wpversion_footer"])){
$checked = $options["ae_admin_remove_wpversion_footer"] != null && $options["ae_admin_remove_wpversion_footer"] == 1 ? true : false;
if ($checked){
return false;
}
}
return $ver;
}
/*
* Implement Remove Version from Scripts and Stylesheets
*/
public static function ae_implement_remove_version_scripts($src){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_version_scripts"])){
$checked = $options["ae_admin_remove_version_scripts"] != null && $options["ae_admin_remove_version_scripts"] == 1 ? true : false;
if ($checked){
$src = remove_query_arg('ver', $src);
return $src;
}
}
return $src;
}
/*
Implement Remove WP Generator Tag
*/
public static function ae_implement_remove_wp_generator($type){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_wp_generator"])){
$checked = $options["ae_admin_remove_wp_generator"] != null && $options["ae_admin_remove_wp_generator"] == 1 ? true : false;
if ($checked){
return false;
}
}
return $type;
}
/*
* Implement Remove Help Tab
*/
public static function ae_implement_remove_help_tab($old_help, $screen_id, $screen){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_help_tab"])){
$checked = $options["ae_admin_remove_help_tab"] != null && $options["ae_admin_remove_help_tab"] == 1 ? true : false;
if ($checked){
$screen->remove_help_tabs();
return $old_help;
}
}
}
/*
* Implement Remove Screen Option Tab
*/
public static function ae_implement_remove_screen_option_tab($display_boolean, $wp_screen_object){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_screen_option_tab"])){
$checked = $options["ae_admin_remove_screen_option_tab"] != null && $options["ae_admin_remove_screen_option_tab"] == 1 ? true : false;
if ($checked){
return false;
}
}
return $display_boolean;
}
/*
* Implement Remove Welcome Widget Dashboard
*/
public static function ae_implement_remove_welcome_widget(){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_welcome_widget"])){
$checked = $options["ae_admin_remove_welcome_widget"] != null && $options["ae_admin_remove_welcome_widget"] == 1 ? true : false;
if ($checked){
remove_action('welcome_panel', 'wp_welcome_panel');
}
}
}
/*
* Implement Remove WP News Widget Dashboard
*/
public static function ae_implement_remove_news_widget_dashboard(){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_remove_news_widget"])){
$checked = $options["ae_admin_remove_news_widget"] != null && $options["ae_admin_remove_news_widget"] == 1 ? true : false;
if ($checked){
remove_meta_box('dashboard_primary', 'dashboard', 'side');
}
}
}
/*
Implement Admin Footer Text
*/
public static function ae_implement_change_wp_footer_text($text){
$options = get_option( 'ae_admin_customizer_options' );
if(isset($options["ae_admin_footer_text"]) && !empty($options["ae_admin_footer_text"])){
echo $options["ae_admin_footer_text"];
}else{
echo $text;
}
}
}
new AE_Admin_General_Settings();