<?php
function logingpower_loginlogo_hide() {
		if ( !empty(get_option('logingpower_settings')['logingpower_loginlogo_hide'] ) ){
			$logingpower_style= "body.login div#login h1 a {
				background-image: none;
				color: #999;
				height: 80px;
				font-size: 20px;
				font-weight: normal;
				line-height: 1.3em;
				margin: 0 auto 25px;
				padding: 0;
				text-decoration: none;
				width: 80px;
				text-indent: 0px;
				outline: none;
				overflow: hidden;
				display: block;
						}";
			wp_add_inline_style('login',$logingpower_style);
		}else{
			if ( !empty(get_option('logingpower_settings')['logingpower_customlogo_show'] ) ){
				$logingpower_style='body.login div#login h1 a {
					background-image: url(' . esc_url( get_option('logingpower_settings')['logingpower_loginlogo_img'] ) . ')!important;
				}';
			wp_add_inline_style('login',$logingpower_style);	
			}
		}

	}add_action( 'login_enqueue_scripts', 'logingpower_loginlogo_hide') ;
	// add_action( 'login_head', 'logingpower_loginlogo_hide') ;
	
	function logingpower_loginlogo_text() {
		if ( !empty(get_option('logingpower_settings')['logingpower_loginlogo_text'] ) ){
			return sanitize_text_field(get_option('logingpower_settings')['logingpower_loginlogo_text']) ;
		}else{
			return sanitize_text_field('Powered by WordPress');
		}
	}add_filter( 'login_headertext', 'logingpower_loginlogo_text' );

	function logingpower_loginlogo_url(){
		if ( !empty(get_option('logingpower_settings')['logingpower_loginlogo_url']) ) {
			return  sanitize_url(get_option('logingpower_settings')['logingpower_loginlogo_url']) ;
		}else{
			return sanitize_url('https://wordpress.org/');
		}
	 }add_filter( 'login_headerurl', 'logingpower_loginlogo_url' );