Support » Plugin: Login With Ajax » [Plugin: Login With Ajax] Either Remove Password OR White Branding

Viewing 2 replies - 1 through 2 (of 2 total)
  • Never Mind – Have figured it out

    @webowner – Would you mind sharing how you accomplished this? I did not know how to manipulate the string data.error was outputting, so I just swapped in my own string ($mymessage). I’m thinking there is a better way to accomplish this.

    //Handle a AJAX call for Login, RememberMe or Registration
    	function lwaAjax( data, statusElement, prependTo ){
    		$('#LoginWithAjax_Loading').remove();
    		if( data.result === true || data.result === false ){
    			if(data.result === true){
    				//Login Successful
    				if( $('#'+statusElement).length > 0 ){
    					$('#'+statusElement).attr('class','confirm').html(data.message);
    				}else{
    					$('<span id="'+statusElement+'" class="confirm">'+data.message+'</span>').prependTo( prependTo );
    				}
    			}else{
    				//Login Failed
    				//If there already is an error element, replace text contents, otherwise create a new one and insert it
    				if( $('#'+statusElement).length > 0 ){
    					$mymessage = '<strong>ERROR</strong>: Invalid username. <a href="mylink" title="My help title">Need Help?</a>';
    					$('#'+statusElement).attr('class','invalid').html($mymessage);
    					/*$('#'+statusElement).attr('class','invalid').html(data.error);*/
    				}else{
    					$('<span id="'+statusElement+'" class="invalid">'+data.error+'</span>').prependTo( prependTo );
    				}
    				//We assume a link in the status message is for a forgotten password
    				$('#'+statusElement).click(function(event){
    					event.preventDefault();
    					$('#LoginWithAjax_Remember').show('slow');
    				});
    			}
    		}else{
    			//If there already is an error element, replace text contents, otherwise create a new one and insert it
    			if( $('#'+statusElement).length > 0 ){
    				$('#'+statusElement).attr('class','invalid').html('An error has occured. Please try again.');
    			}else{
    				$('<span id="'+statusElement+'" class="invalid">An error has occured. Please try again.</span>').prependTo( prependTo );
    			}
    		}
    	}

    For those of you having trouble getting started on this – you need to override the login-with-ajax.js file by creating a new one (if you haven’t already) at wp-content/themes/yourtheme/plugins/login-with-ajax/ to make the change you implement update safe (this way you aren’t touching the source code). See the readme file included with the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Login With Ajax] Either Remove Password OR White Branding’ is closed to new replies.