From 95f756e4fcea0dd85a1c5dfe2b39cb2c8070066e Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 8 Jan 2014 03:52:47 +0000 Subject: [PATCH] Inline documentation for hooks in wp-admin/includes/class-wp-media-list-table.php. Props theorboman for the initial patch. Props kpdesign. Fixes #25839. git-svn-id: https://develop.svn.wordpress.org/trunk@26916 602fd350-edb4-49c9-b593-d223f7449a82 --- .../includes/class-wp-media-list-table.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index 1f0067dd8a..4d0bfe4612 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -90,6 +90,7 @@ class WP_Media_List_Table extends WP_List_Table { if ( 'top' == $which && !is_singular() && !$this->detached && !$this->is_trash ) { $this->months_dropdown( 'attachment' ); + /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ do_action( 'restrict_manage_posts' ); submit_button( __( 'Filter' ), 'button', false, false, array( 'id' => 'post-query-submit' ) ); } @@ -137,6 +138,14 @@ class WP_Media_List_Table extends WP_List_Table { $taxonomies = get_taxonomies_for_attachments( 'objects' ); $taxonomies = wp_filter_object_list( $taxonomies, array( 'show_admin_column' => true ), 'and', 'name' ); + /** + * Filter the taxonomy columns for attachments in the Media list table. + * + * @since 3.5.0 + * + * @param array $taxonomies An array of registered taxonomies to show for attachments. + * @param string $post_type The post type. Default 'attachment'. + */ $taxonomies = apply_filters( 'manage_taxonomies_for_attachment_columns', $taxonomies, 'attachment' ); $taxonomies = array_filter( $taxonomies, 'taxonomy_exists' ); @@ -159,6 +168,15 @@ class WP_Media_List_Table extends WP_List_Table { } /* translators: column name */ $posts_columns['date'] = _x( 'Date', 'column name' ); + /** + * Filter the Media list table columns. + * + * @since 2.5.0 + * + * @param array $posts_columns An array of columns displayed in the Media list table. + * @param bool $detached Whether the list table contains media not attached + * to any posts. Default true. + */ $posts_columns = apply_filters( 'manage_media_columns', $posts_columns, $this->detached ); return $posts_columns; @@ -383,6 +401,18 @@ foreach ( $columns as $column_name => $column_display_name ) { } ?> > + ID ); ?> $column_display_name ) { } } + /** + * Filter the action links for each attachment in the Media list table. + * + * @since 2.8.0 + * + * @param array $actions An array of action links for each attachment. + * Default 'Edit', 'Delete Permanently', 'View'. + * @param WP_Post $post WP_Post object for the current attachment. + * @param bool $detached Whether the list table contains media not attached + * to any posts. Default true. + */ $actions = apply_filters( 'media_row_actions', $actions, $post, $this->detached ); return $actions;