WordPress.org

Plugin Directory

Changeset 1493137


Ignore:
Timestamp:
09/09/16 10:29:18 (10 months ago)
Author:
pgogy
Message:

Admin side fix
Attempt to neaten up comments code

Location:
anonymous-comments
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • anonymous-comments/trunk/anonymous_comments.php

    r1491269 r1493137  
    44    Plugin Name: Anonymous Comment 
    55    Description: Allows a page to have anonymous comments 
    6     Version: 0.2 
     6    Version: 0.3 
    77    Author: pgogy 
    88    Author URI: http://www.pgogywebstuff.com 
  • anonymous-comments/trunk/code/display/class-anonymous_comments_display.php

    r1491269 r1493137  
    77        add_filter('get_avatar', array($this, 'avatar'), 10 , 5); 
    88        add_filter('get_comment_author_url', array($this, 'url'),10,3); 
    9         add_filter('comment_email', array($this, 'email'), 10, 3); 
     9        add_filter('comment_email', array($this, 'email'), 10, 2); 
    1010        add_action('comment_form', array($this, 'additional')); 
    1111    } 
     
    1818    } 
    1919     
    20     function email( $email, $comment_ID, $comment ) { 
     20    function email( $email, $comment_ID) { 
    2121         
    2222        if(is_admin()){ 
     
    129129     
    130130        if(is_admin()){ 
    131             if (defined('DOING_AJAX')){ 
     131            if (defined('DOING_AJAX')){  
    132132                if(!DOING_AJAX) { 
    133133                    return $author; 
    134134                } 
     135            }else{ 
     136                return $author; 
    135137            } 
     138 
    136139        } 
    137          
     140 
    138141        if(get_post_meta($comment->comment_post_ID, "anonymous_comments",true)!==""){ 
    139142         
     
    149152             
    150153            if($comment->user_id==$post->post_author){ 
    151                 if(get_post_meta($post->ID, "show_author_anonymous_comments", true)!==""){ 
     154                if(get_post_meta($comment->comment_post_ID, "show_author_anonymous_comments", true)!==""){ 
    152155                    return $author; 
    153156                } 
    154157            } 
    155158             
    156             $authors = get_post_meta($comment->comment_post_ID, "comment_authors", true); 
     159            $authors = get_post_meta($comment->comment_post_ID, "anonymous_comment_authors", true); 
    157160            if(!is_array($authors)){ 
    158161                $authors = array(); 
     
    161164            if(!in_array($author, $authors)){ 
    162165                $authors[] = $author; 
    163                 update_post_meta($comment->comment_post_ID, "comment_authors", $authors); 
     166                update_post_meta($comment->comment_post_ID, "anonymous_comment_authors", $authors); 
    164167                return __("Anonymous Commenter") . " " . count($authors); 
    165168            }else{ 
  • anonymous-comments/trunk/readme.txt

    r1491269 r1493137  
    44Requires at least: 3.0.1 
    55Tested up to: 4.6 
    6 Stable tag: 0.2 
     6Stable tag: 0.3 
    77License: GPLv2 or later 
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html 
Note: See TracChangeset for help on using the changeset viewer.