Skip to content

Commit 8a59742

Browse files
Docs: Add missing descriptions for WP_Media_List_Table methods.
Follow-up to [11749], [15491], [31162], [32654], [61594]. Props noruzzaman. See #64224. git-svn-id: https://develop.svn.wordpress.org/trunk@61683 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 4419c01 commit 8a59742

1 file changed

Lines changed: 42 additions & 7 deletions

File tree

src/wp-admin/includes/class-wp-media-list-table.php

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,20 @@ class WP_Media_List_Table extends WP_List_Table {
2323
*/
2424
protected $comment_pending_count = array();
2525

26+
/**
27+
* Whether the list table is for detached media.
28+
*
29+
* @since 3.1.0
30+
* @var bool
31+
*/
2632
private $detached;
2733

34+
/**
35+
* Whether the list table is for trash.
36+
*
37+
* @since 3.1.0
38+
* @var bool
39+
*/
2840
private $is_trash;
2941

3042
/**
@@ -53,17 +65,25 @@ public function __construct( $args = array() ) {
5365
}
5466

5567
/**
68+
* Checks if the current user has permissions to upload files.
69+
*
70+
* @since 3.1.0
71+
*
5672
* @return bool Whether the user can upload files.
5773
*/
5874
public function ajax_user_can() {
5975
return current_user_can( 'upload_files' );
6076
}
6177

6278
/**
79+
* Prepares the list of items for displaying.
80+
*
81+
* @since 3.1.0
82+
*
6383
* @global string $mode List table view mode.
6484
* @global WP_Query $wp_query WordPress Query object.
65-
* @global array $post_mime_types
66-
* @global array $avail_post_mime_types
85+
* @global array $post_mime_types An array of post mime types.
86+
* @global array $avail_post_mime_types An array of available post mime types.
6787
*/
6888
public function prepare_items() {
6989
global $mode, $wp_query, $post_mime_types, $avail_post_mime_types;
@@ -117,8 +137,12 @@ public function prepare_items() {
117137
}
118138

119139
/**
120-
* @global array $post_mime_types
121-
* @global array $avail_post_mime_types
140+
* Gets an array of links for the available views on this table.
141+
*
142+
* @since 3.1.0
143+
*
144+
* @global array $post_mime_types An array of post mime types.
145+
* @global array $avail_post_mime_types An array of available post mime types.
122146
* @return array<string, string> An array of links for the available views.
123147
*/
124148
protected function get_views() {
@@ -198,7 +222,11 @@ protected function get_bulk_actions() {
198222
}
199223

200224
/**
201-
* @param string $which
225+
* Displays extra controls between bulk actions and pagination.
226+
*
227+
* @since 3.1.0
228+
*
229+
* @param string $which The location of the extra table nav: 'top' or 'bottom'.
202230
*/
203231
protected function extra_tablenav( $which ) {
204232
if ( 'bar' !== $which ) {
@@ -253,6 +281,9 @@ public function has_items() {
253281
}
254282

255283
/**
284+
* Displays a message when no media items are found.
285+
*
286+
* @since 3.1.0
256287
*/
257288
public function no_items() {
258289
if ( $this->is_trash ) {
@@ -762,8 +793,12 @@ protected function get_default_primary_column_name() {
762793
}
763794

764795
/**
765-
* @param WP_Post $post
766-
* @param string $att_title
796+
* Gets the row actions for a media item.
797+
*
798+
* @since 3.1.0
799+
*
800+
* @param WP_Post $post The current WP_Post object.
801+
* @param string $att_title The attachment title.
767802
* @return array<string, string> An array of row actions.
768803
*/
769804
private function _get_row_actions( $post, $att_title ) {

0 commit comments

Comments
 (0)