Plugin Directory

Changeset 1202456


Ignore:
Timestamp:
07/20/2015 05:13:53 PM (11 years ago)
Author:
buildcreate
Message:

Updated comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • agreeable/trunk/agreeable.php

    r1145121 r1202456  
    44Plugin URI: http://wordpress.org/extend/plugins/agreeable
    55Description: Add a required "Agree to terms" checkbox to login and/or register forms.
    6 Version: 1.3.9.6
     6Version: 1.4
    77Author: kraftpress
    88Author URI: http://kraftpress.it
     
    4949        add_filter('register_form', array($this, 'ag_register_terms_accept'));
    5050        add_filter('comment_form_after_fields', array($this, 'ag_comment_terms_accept'));
     51        add_filter('comment_form_logged_in_after', array($this, 'ag_comment_terms_accept'));
    5152        add_action('bp_before_registration_submit_buttons', array($this, 'ag_register_terms_accept'));
    5253        add_action('tml_register_form', array($this, 'ag_register_terms_accept'), 10, 3);
     
    179180                return $user;
    180181       
    181 
    182182            } else {
    183183
     
    263263            // See if the checkbox #ag_login_accept was checked
    264264            if ( isset( $_REQUEST['ag_login_accept'] ) && $_REQUEST['ag_login_accept'] == 1 ) {
     265               
    265266                // Checkbox on, allow comment
    266                 //do_action('agreeable_validate_user', $user, $_REQUEST['ag_type']);
     267                // Grab info from the form
     268               
     269                global $current_user;
     270               
     271                if(is_user_logged_in()) {
     272                    $user = $current_user->ID;
     273                } else {
     274                    $user = array('author' => $_REQUEST['author'], 'email' => $_REQUEST['email']);
     275                }
     276               
     277                do_action('agreeable_validate_user', $user, $_REQUEST['ag_type']);
    267278                return $comment;
     279               
    268280            } else {
    269281                // Did NOT check the box, do not allow comment
Note: See TracChangeset for help on using the changeset viewer.