-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Docs: Fix missing documentation in Media and Plugin Install list tables #11023
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from 5 commits
a6dfa21
6dea284
adf8e85
b865078
668aca4
489c77f
4574c4b
28a3cc6
6c5b333
5f9e0b5
c81a3c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,11 @@ class WP_Plugin_Install_List_Table extends WP_List_Table { | |
| private $error; | ||
|
|
||
| /** | ||
| * @return bool | ||
| * Checks if the current user has permissions to perform an Ajax action. | ||
| * | ||
| * @since 3.1.0 | ||
| * | ||
| * @return bool Whether the current user can perform an Ajax action. | ||
| */ | ||
| public function ajax_user_can() { | ||
| return current_user_can( 'install_plugins' ); | ||
|
|
@@ -80,11 +84,15 @@ protected function get_installed_plugin_slugs() { | |
| } | ||
|
|
||
| /** | ||
| * @global array $tabs | ||
| * @global string $tab | ||
| * @global int $paged | ||
| * @global string $type | ||
| * @global string $term | ||
| * Prepares the plugins list for display. | ||
| * | ||
| * @since 3.1.0 | ||
| * | ||
| * @global array $tabs The tabs shown on the Add Plugins screen. | ||
| * @global string $tab The current active tab. | ||
| * @global int $paged The current page number. | ||
| * @global string $type The type of search being performed. | ||
| * @global string $term The search term. | ||
| */ | ||
| public function prepare_items() { | ||
| require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; | ||
|
|
@@ -287,6 +295,9 @@ public function prepare_items() { | |
| } | ||
|
|
||
| /** | ||
| * Outputs the message when no plugins are found. | ||
| * | ||
| * @since 3.1.0 | ||
| */ | ||
| public function no_items() { | ||
| if ( isset( $this->error ) ) { | ||
|
|
@@ -307,10 +318,14 @@ public function no_items() { | |
| } | ||
|
|
||
| /** | ||
| * @global array $tabs | ||
| * @global string $tab | ||
| * Gets the list of views (tabs) available for the plugins list table. | ||
| * | ||
| * @return array | ||
| * @since 3.1.0 | ||
| * | ||
| * @global array $tabs The tabs shown on the Add Plugins screen. | ||
| * @global string $tab The current active tab. | ||
| * | ||
| * @return array Array of view links. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the feedback! I have fleshed out the types for $tabs and the return value |
||
| */ | ||
| protected function get_views() { | ||
| global $tabs, $tab; | ||
|
|
@@ -330,7 +345,9 @@ protected function get_views() { | |
| } | ||
|
|
||
| /** | ||
| * Overrides parent views so we can use the filter bar display. | ||
| * Displays the view (tabs) switcher for the plugins list table. | ||
| * | ||
| * @since 3.1.0 | ||
| */ | ||
| public function views() { | ||
| $views = $this->get_views(); | ||
|
|
@@ -395,9 +412,13 @@ public function display() { | |
| } | ||
|
|
||
| /** | ||
| * @global string $tab | ||
| * Generates the table navigation. | ||
| * | ||
| * @param string $which | ||
| * @since 3.1.0 | ||
| * | ||
| * @global string $tab The current active tab. | ||
| * | ||
| * @param string $which The location of the pagination: 'top' or 'bottom'. | ||
| */ | ||
| protected function display_tablenav( $which ) { | ||
| if ( 'featured' === $GLOBALS['tab'] ) { | ||
|
|
@@ -431,23 +452,35 @@ protected function display_tablenav( $which ) { | |
| } | ||
|
|
||
| /** | ||
| * @return array | ||
| * Gets the list of CSS classes for the table container. | ||
| * | ||
| * @since 3.1.0 | ||
| * | ||
| * @return array Array of CSS classes. | ||
|
noruzzamans marked this conversation as resolved.
Outdated
|
||
| */ | ||
| protected function get_table_classes() { | ||
| return array( 'widefat', $this->_args['plural'] ); | ||
| } | ||
|
|
||
| /** | ||
| * @return string[] Array of column titles keyed by their column name. | ||
| * Gets the list of columns for the plugins list table. | ||
| * | ||
| * @since 3.1.0 | ||
| * | ||
| * @return array Array of column titles. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be reducing information? Granted, it is returning an empty array.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My apologies for the oversight. I have updated the doc blocks and restored the missing info. |
||
| */ | ||
| public function get_columns() { | ||
| return array(); | ||
| } | ||
|
|
||
| /** | ||
| * @param object $plugin_a | ||
| * @param object $plugin_b | ||
| * @return int | ||
| * Callback for sorting plugins. | ||
| * | ||
| * @since 3.1.0 | ||
| * | ||
| * @param object $plugin_a The first plugin object. | ||
| * @param object $plugin_b The second plugin object. | ||
| * @return int Comparison result. | ||
| */ | ||
| private function order_callback( $plugin_a, $plugin_b ) { | ||
| $orderby = $this->orderby; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.