Changeset 953592
- Timestamp:
- 07/23/2014 04:45:54 PM (12 years ago)
- Location:
- agreeable/trunk
- Files:
-
- 4 edited
-
agreeable.php (modified) (6 diffs)
-
css/front.css (modified) (1 diff)
-
js/agreeable.js (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
agreeable/trunk/agreeable.php
r953516 r953592 4 4 Plugin URI: http://wordpress.org/extend/plugins/agreeable 5 5 Description: Add a required "Agree to terms" checkbox to login and/or register forms. Based on the I-Agree plugin by Michael Stursberg. 6 Version: 0.3.4. 16 Version: 0.3.4.2 7 7 Author: kraftpress 8 8 Author URI: http://kraftpress.it … … 21 21 function ag_front() { 22 22 /* Only load lightbox code on the frontend, where we need it */ 23 if ( is_login_page() ) { 24 wp_enqueue_script('jquery'); 25 } 23 26 wp_enqueue_script( 'magnific', plugins_url('js/magnific.js', __FILE__),'', '', true); 24 27 wp_enqueue_script( 'agreeable-js', plugins_url('js/agreeable.js', __FILE__), '', '', true); 25 28 wp_enqueue_style( 'magnific', plugins_url('css/magnific.css', __FILE__)); 26 wp_enqueue_style( ' magnific', plugins_url('css/front.css', __FILE__));29 wp_enqueue_style( 'agreeable-css', plugins_url('css/front.css', __FILE__)); 27 30 } 28 31 … … 30 33 add_action('admin_enqueue_scripts', 'ag_admin'); 31 34 add_action('wp_enqueue_scripts', 'ag_front'); 35 add_action('login_enqueue_scripts', 'ag_front'); 32 36 33 37 function ag_authenticate_user_acc($user) { … … 73 77 } 74 78 79 } 80 81 add_filter('woocommerce_registration_errors', 'ag_woocommerce_reg_validation', 10,3); 82 83 function ag_woocommerce_reg_validation($reg_errors, $sanitized_user_login, $user_email) { 84 global $woocommerce; 85 $dbfail = get_option('ag_fail'); 86 87 if(!isset($_REQUEST['login_accept'])) { 88 89 if ( !isset($_COOKIE['agreeable_terms'] ) && $dbremember == 1 || $dbremember == 0) { 90 return new WP_Error('registration-error', __($dbfail, 'woocommerce')); 91 $woocommerce->add_error( __( $dbfail, 'woocommerce' ) ); 92 } else { 93 94 } 95 } 96 97 if ( !isset( $_COOKIE['agreeable_terms'] ) && $dbremember == 1 ) { 98 setcookie( 'agreeable_terms', 'yes', strtotime('+30 days'), COOKIEPATH, COOKIE_DOMAIN, false ); 99 } 100 101 return $reg_errors; 75 102 } 76 103 … … 177 204 } 178 205 206 179 207 // As part of WP login form construction, call our function 180 208 add_filter('login_form', 'ag_login_terms_accept' ); 209 add_filter('woocommerce_after_customer_login_form', 'ag_login_terms_accept'); 181 210 add_filter('register_form', 'ag_register_terms_accept'); 182 211 add_filter('comment_form_after_fields', 'ag_comment_terms_accept'); … … 270 299 271 300 add_action( 'plugins_loaded', 'ag_send_feedback'); 301 302 function is_login_page() { 303 return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php')); 304 } -
agreeable/trunk/css/front.css
r953516 r953592 2 2 3 3 .mfp-hide {display: none;} 4 5 #terms {} 6 #terms h1, #terms h2 {margin-bottom: .5em; font-size: 2em;} 7 #terms h3, #terms h4 {margin-bottom: .5em; font-size: 1.3em;} 8 #terms ul, #terms ol {padding-left: 2em; margin-bottom: 1em;} 9 #terms p {margin-bottom: 1em;} -
agreeable/trunk/js/agreeable.js
r946511 r953592 4 4 midClick: true 5 5 }); 6 7 if($('.woocommerce .login')) { 8 $(".woocommerce>#terms-accept").insertBefore(".woocommerce .login #rememberme"); 9 10 } 11 6 12 }); -
agreeable/trunk/readme.txt
r953522 r953592 41 41 42 42 == Changelog == 43 44 = 3.4.2 = 45 * Fixed WooCommerce registration bug 43 46 44 47 = 3.4.1 =
Note: See TracChangeset
for help on using the changeset viewer.