Make WordPress Core

Changeset 34069


Ignore:
Timestamp:
09/12/2015 02:27:50 AM (9 years ago)
Author:
wonderboymusic
Message:

When clicking "Show More Comments" in the Comments meta box on the Edit Post screen, change the click behavior to call a new class method on commentsBox, ->load(), that resets st (cool name) to the number of visible <tr>s before calling ->get(). This will account for spam'd and trash'd comments when returning comments at the proper offset.

Props utkarshpatel.
Fixes #33829.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r33686 r34069  
    691691
    692692        ?>
    693         <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <span class="spinner"></span></p>
     693        <p class="hide-if-no-js" id="show-comments"><a href="#commentstatusdiv" onclick="commentsBox.load(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <span class="spinner"></span></p>
    694694        <?php
    695695    }
  • trunk/src/wp-admin/js/post.js

    r33836 r34069  
    6060
    6161        return false;
     62    },
     63
     64    load: function(total){
     65        this.st = jQuery('#the-comment-list tr.comment:visible').length;
     66        this.get(total);
    6267    }
    6368};
  • trunk/src/wp-includes/comment-template.php

    r34039 r34069  
    854854    $comment = get_comment( $comment_ID );
    855855
    856     $comment_text = get_comment_text( $comment_ID , $args );
     856    $comment_text = get_comment_text( $comment, $args );
    857857    /**
    858858     * Filter the text of a comment to be displayed.
Note: See TracChangeset for help on using the changeset viewer.