Make WordPress Core

Ticket #25662: class-wp-comments-list-table.2.patch

File class-wp-comments-list-table.2.patch, 4.5 KB (added by siobhyb, 12 years ago)

Second pass at inline docs for wp-admin/includes/class-wp-comments-list-table.php. Including correct notation for duplicate hooks.

  • class-wp-comments-list-table.php

     
    127127
    128128        function get_per_page( $comment_status = 'all' ) {
    129129                $comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' );
     130                /**
     131                * Filter the number of comments listed per page in the comments list table.
     132                *
     133                * @since 2.6.0
     134                *
     135                * @param int $comments_per_page The number of comments to list per page.
     136                * @param string $comment_status The comment status name. Default is 'All'.
     137                */
    130138                $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
    131139                return $comments_per_page;
    132140        }
     
    180188                                number_format_i18n( $num_comments->$status )
    181189                        ) . '</a>';
    182190                }
    183 
     191               
     192                /**
     193                * Filter the comment status links.
     194                *
     195                * Allows the status links used to filter the comments list table to be modified.
     196                * The default comment statuses are 'All', 'Pending', 'Approved', 'Spam', and 'Trash'.
     197                *
     198                * @since 2.5.0
     199                *
     200                * @param array $status_links An array of fully-formed status links.
     201                */
    184202                $status_links = apply_filters( 'comment_status_links', $status_links );
    185203                return $status_links;
    186204        }
     
    219237                        <select name="comment_type">
    220238                                <option value=""><?php _e( 'Show all comment types' ); ?></option>
    221239<?php
     240                                /**
     241                                * Filter the comment types drop down menu.
     242                                *
     243                                * Allows the options supplied to the comment types drop down in the Comments screen to be modified.
     244                                * The built-in comment type values are 'Comments' and 'Pings'.
     245                                *
     246                                * @since 2.7.0
     247                                *
     248                                * @param array An array of comment types to be used as options in the drop down.
     249                                */
    222250                                $comment_types = apply_filters( 'admin_comment_types_dropdown', array(
    223251                                        'comment' => __( 'Comments' ),
    224252                                        'pings' => __( 'Pings' ),
     
    229257                        ?>
    230258                        </select>
    231259<?php
     260                        /**
     261                        * Fires just before the "Filter" submit button on the comments list table.
     262                        *
     263                        * Allows additional filtering capabilities for the comments list table.
     264                        *
     265                        * @since 3.5.0
     266                        */
    232267                        do_action( 'restrict_manage_comments' );
    233268                        submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) );
    234269                }
     
    238273                        $title = ( 'spam' == $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
    239274                        submit_button( $title, 'apply', 'delete_all', false );
    240275                }
     276                /**
     277                * Fires after the "Filter" submit button on the comments list table.
     278                *
     279                * Allows the filtering options menu for the comments list table to be extended.
     280                *
     281                * @since 2.5.0
     282                *
     283                * @param string $comment_status The comment status name. Default is 'All'.
     284                */
    241285                do_action( 'manage_comments_nav', $comment_status );
    242286                echo '</div>';
    243287        }
     
    373417                comment_text();
    374418                if ( $user_can ) { ?>
    375419                <div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
    376                 <textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( apply_filters( 'comment_edit_pre', $comment->comment_content ) ); ?></textarea>
     420                <textarea class="comment" rows="1" cols="1">
     421                        <?php
     422                        /** This filter is documented in wp-admin/includes/comment.php */
     423                        echo esc_textarea( apply_filters( 'comment_edit_pre', $comment->comment_content ) );
     424                        ?>
     425                </textarea>
    377426                <div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
    378427                <div class="author"><?php echo esc_attr( $comment->comment_author ); ?></div>
    379428                <div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
     
    423472                                $actions['reply'] = '<a onclick="commentReply.open( \''.$comment->comment_ID.'\',\''.$post->ID.'\' );return false;" class="vim-r" title="'.esc_attr__( 'Reply to this comment' ).'" href="#">' . __( 'Reply' ) . '</a>';
    424473                        }
    425474
     475                        /** This filter is documented in wp-admin/includes/dashboard.php */
    426476                        $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
    427477
    428478                        $i = 0;
     
    510560        }
    511561
    512562        function column_default( $comment, $column_name ) {
     563                /**
     564                * Fires in comments list table's custom columns.
     565                *
     566                * Allows content to be added to custom columns in the comments list table.
     567                *
     568                * @since 2.8.0
     569                *
     570                * @param string $column_name            The custom column's name.
     571                * @param int $comment->comment_ID       The custom column's unique ID number.
     572                */
    513573                do_action( 'manage_comments_custom_column', $column_name, $comment->comment_ID );
    514574        }
    515575}