From b140e8f5742c7eb82624d02e51e697409a160868 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Thu, 3 Aug 2017 15:43:43 +0000 Subject: [PATCH] General: Fix various instances of incorrect filter docs and incorrect filter and action parameters. Props keesiemeijer for identifying the issues See #38462 Built from https://develop.svn.wordpress.org/trunk@41219 git-svn-id: http://core.svn.wordpress.org/trunk@41059 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-ms-themes-list-table.php | 4 ++-- wp-admin/includes/class-wp-posts-list-table.php | 5 +++-- wp-admin/includes/class-wp-press-this.php | 2 +- wp-admin/includes/class-wp-themes-list-table.php | 4 ++-- wp-admin/includes/ms.php | 2 +- .../rest-api/endpoints/class-wp-rest-posts-controller.php | 2 +- .../endpoints/class-wp-rest-revisions-controller.php | 2 +- wp-includes/theme.php | 2 +- wp-includes/version.php | 2 +- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/wp-admin/includes/class-wp-ms-themes-list-table.php b/wp-admin/includes/class-wp-ms-themes-list-table.php index fb3c33e7ad..eb0d6777ce 100644 --- a/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -479,7 +479,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { * * @param array $actions An array of action links. * @param WP_Theme $theme The current WP_Theme object. - * @param string $context Status of the theme. + * @param string $context Status of the theme, one of all', 'enabled', or 'disabled'. */ $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context ); @@ -495,7 +495,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { * * @param array $actions An array of action links. * @param WP_Theme $theme The current WP_Theme object. - * @param string $context Status of the theme. + * @param string $context Status of the theme, one of all', 'enabled', or 'disabled'. */ $actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, $context ); diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 524637b1d4..40f5315395 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -1720,9 +1720,10 @@ class WP_Posts_List_Table extends WP_List_Table { * @since 2.7.0 * * @param string $column_name Name of the column to edit. - * @param string $post_type The post type slug. + * @param string $post_type The post type slug, or current screen name if this is a taxonomy list table. + * @param string taxonomy The taxonomy name, if any. */ - do_action( 'quick_edit_custom_box', $column_name, $screen->post_type ); + do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' ); } } diff --git a/wp-admin/includes/class-wp-press-this.php b/wp-admin/includes/class-wp-press-this.php index 955c7d7b20..1a30e4104d 100644 --- a/wp-admin/includes/class-wp-press-this.php +++ b/wp-admin/includes/class-wp-press-this.php @@ -1522,7 +1522,7 @@ class WP_Press_This { ' . __( 'Delete' ) . ''; /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */ - $actions = apply_filters( 'theme_action_links', $actions, $theme ); + $actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' ); /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */ - $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme ); + $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, 'all' ); $delete_action = isset( $actions['delete'] ) ? '
' . $actions['delete'] . '
' : ''; unset( $actions['delete'] ); diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 83bcd1bbc3..e746982e41 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -260,7 +260,7 @@ function wpmu_delete_user( $id ) { clean_user_cache( $user ); /** This action is documented in wp-admin/includes/user.php */ - do_action( 'deleted_user', $id ); + do_action( 'deleted_user', $id, null ); return true; } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 417dce0288..f9de7360bd 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1382,7 +1382,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { if ( ! empty( $schema['properties']['guid'] ) ) { $data['guid'] = array( /** This filter is documented in wp-includes/post-template.php */ - 'rendered' => apply_filters( 'get_the_guid', $post->guid ), + 'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ), 'raw' => $post->guid, ); } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php index 16da36bc42..fdb01dcbca 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php @@ -369,7 +369,7 @@ class WP_REST_Revisions_Controller extends WP_REST_Controller { if ( ! empty( $schema['properties']['guid'] ) ) { $data['guid'] = array( /** This filter is documented in wp-includes/post-template.php */ - 'rendered' => apply_filters( 'get_the_guid', $post->guid ), + 'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ), 'raw' => $post->guid, ); } diff --git a/wp-includes/theme.php b/wp-includes/theme.php index a1cc0866b2..2b2fbf2403 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -2749,7 +2749,7 @@ function check_theme_switched() { do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme ); } else { /** This action is documented in wp-includes/theme.php */ - do_action( 'after_switch_theme', $stylesheet ); + do_action( 'after_switch_theme', $stylesheet, $old_theme ); } flush_rewrite_rules(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 10c3f954ad..ae157d9b2e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41218'; +$wp_version = '4.9-alpha-41219'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.