Completed
Push — master ( 201c1b...d51ce1 )
by Dwain
04:57
created
includes/class-sensei-frontend.php 1 patch
Braces   +30 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+if ( ! defined( 'ABSPATH' ) ) {
3
+	exit;
4
+}
5
+// Exit if accessed directly
3 6
 
4 7
 /**
5 8
  * Sensei Frontend Class
@@ -668,7 +671,9 @@  discard block
 block discarded – undo
668 671
 	public function sensei_breadcrumb( $id = 0 ) {
669 672
 
670 673
 		// Only output on lesson, quiz and taxonomy (module) pages
671
-		if( ! ( is_tax( 'module' ) || is_singular( 'lesson' ) || is_singular( 'quiz' ) ) ) return;
674
+		if( ! ( is_tax( 'module' ) || is_singular( 'lesson' ) || is_singular( 'quiz' ) ) ) {
675
+			return;
676
+		}
672 677
 
673 678
 		if( empty( $id )  ){
674 679
 
@@ -1094,17 +1099,26 @@  discard block
 block discarded – undo
1094 1099
 
1095 1100
 						<p class="form-row form-row-wide">
1096 1101
 							<label for="sensei_reg_username"><?php _e( 'Username', 'woothemes-sensei' ); ?> <span class="required">*</span></label>
1097
-							<input type="text" class="input-text" name="sensei_reg_username" id="sensei_reg_username" value="<?php if ( ! empty( $_POST['sensei_reg_username'] ) ) esc_attr_e( $_POST['sensei_reg_username'] ); ?>" />
1102
+							<input type="text" class="input-text" name="sensei_reg_username" id="sensei_reg_username" value="<?php if ( ! empty( $_POST['sensei_reg_username'] ) ) {
1103
+	esc_attr_e( $_POST['sensei_reg_username'] );
1104
+}
1105
+?>" />
1098 1106
 						</p>
1099 1107
 
1100 1108
 						<p class="form-row form-row-wide">
1101 1109
 							<label for="sensei_reg_email"><?php _e( 'Email address', 'woothemes-sensei' ); ?> <span class="required">*</span></label>
1102
-							<input type="email" class="input-text" name="sensei_reg_email" id="sensei_reg_email" value="<?php if ( ! empty( $_POST['sensei_reg_email'] ) ) esc_attr_e( $_POST['sensei_reg_email'] ); ?>" />
1110
+							<input type="email" class="input-text" name="sensei_reg_email" id="sensei_reg_email" value="<?php if ( ! empty( $_POST['sensei_reg_email'] ) ) {
1111
+	esc_attr_e( $_POST['sensei_reg_email'] );
1112
+}
1113
+?>" />
1103 1114
 						</p>
1104 1115
 
1105 1116
 						<p class="form-row form-row-wide">
1106 1117
 							<label for="sensei_reg_password"><?php _e( 'Password', 'woothemes-sensei' ); ?> <span class="required">*</span></label>
1107
-							<input type="password" class="input-text" name="sensei_reg_password" id="sensei_reg_password" value="<?php if ( ! empty( $_POST['sensei_reg_password'] ) ) esc_attr_e( $_POST['sensei_reg_password'] ); ?>" />
1118
+							<input type="password" class="input-text" name="sensei_reg_password" id="sensei_reg_password" value="<?php if ( ! empty( $_POST['sensei_reg_password'] ) ) {
1119
+	esc_attr_e( $_POST['sensei_reg_password'] );
1120
+}
1121
+?>" />
1108 1122
 						</p>
1109 1123
 
1110 1124
 						<!-- Spam Trap -->
@@ -1437,8 +1451,12 @@  discard block
 block discarded – undo
1437 1451
 
1438 1452
 		if( Sensei_WC::is_woocommerce_active() ) {
1439 1453
 
1440
-			if( ! is_user_logged_in() ) return;
1441
-			if( ! isset( $post->ID ) ) return;
1454
+			if( ! is_user_logged_in() ) {
1455
+				return;
1456
+			}
1457
+			if( ! isset( $post->ID ) ) {
1458
+				return;
1459
+			}
1442 1460
 
1443 1461
 			$user_id = $current_user->ID;
1444 1462
 			$course_id = $post->ID;
@@ -1599,7 +1617,7 @@  discard block
 block discarded – undo
1599 1617
 		    		//assigne the username to the creds array for further processing
1600 1618
 		    		$creds['user_login'] =  $user->user_login ;
1601 1619
 
1602
-		    	}else{
1620
+		    	} else{
1603 1621
 
1604 1622
 		    		// process this as a default username login
1605 1623
 		    		$creds['user_login'] = sanitize_text_field( $_REQUEST['log'] ) ;
@@ -1616,7 +1634,7 @@  discard block
 block discarded – undo
1616 1634
 				if ( is_wp_error($user) ){ // on login failure
1617 1635
                     wp_redirect( esc_url_raw( add_query_arg('login', 'failed', $referrer) ) );
1618 1636
                     exit;
1619
-				}else{ // on login success
1637
+				} else{ // on login success
1620 1638
 
1621 1639
 					/**
1622 1640
 					* change the redirect url programatically
@@ -1633,14 +1651,14 @@  discard block
 block discarded – undo
1633 1651
 
1634 1652
 				}	// end is_wp_error($user)
1635 1653
 
1636
-		    }else{ // if username or password is empty
1654
+		    } else{ // if username or password is empty
1637 1655
 
1638 1656
                 wp_redirect( esc_url_raw( add_query_arg('login', 'emptyfields', $referrer) ) );
1639 1657
 		        exit;
1640 1658
 
1641 1659
 		    } // end if username $_REQUEST['log']  and password $_REQUEST['pwd'] is empty
1642 1660
 
1643
-	    }elseif( ( isset( $_GET['login'] ) ) ) {
1661
+	    } elseif( ( isset( $_GET['login'] ) ) ) {
1644 1662
 	    	// else if this request is a redircect from a previously faile login request
1645 1663
 	    	$this->login_message_process();
1646 1664
 
@@ -1762,7 +1780,7 @@  discard block
 block discarded – undo
1762 1780
 
1763 1781
 				$message = __('Incorrect login details', 'woothemes-sensei' );
1764 1782
 
1765
-			}elseif( $_GET['login'] == 'emptyfields'  ){
1783
+			} elseif( $_GET['login'] == 'emptyfields'  ){
1766 1784
 
1767 1785
 				$message= __('Please enter your username and password', 'woothemes-sensei' );
1768 1786
 			}
Please login to merge, or discard this patch.