From 3ee58b55b14683af4c568bce1845c37408c88fbb Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 14 May 2018 14:53:21 +0000 Subject: [PATCH] Privacy: improve inline documentation. Props desrosj. Fixes #44075. Built from https://develop.svn.wordpress.org/trunk@43256 git-svn-id: http://core.svn.wordpress.org/trunk@43085 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/user.php | 51 ++++++++++++++++++++------------------ wp-includes/user.php | 8 +++--- wp-includes/version.php | 2 +- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index 79286f1014..d36108729b 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -587,7 +587,7 @@ Please click the following link to activate your user account: * @access private * * @param int $request_id Request ID. - * @return bool|WP_Error + * @return bool|WP_Error Returns true/false based on the success of sending the email, or a WP_Error object. */ function _wp_privacy_resend_request( $request_id ) { $request_id = absint( $request_id ); @@ -754,6 +754,7 @@ function _wp_personal_data_handle_actions() { function _wp_personal_data_cleanup_requests() { /** This filter is documented in wp-includes/user.php */ $expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS ); + $requests_query = new WP_Query( array( 'post_type' => 'user_request', 'posts_per_page' => -1, @@ -1011,13 +1012,16 @@ if ( ! class_exists( 'WP_List_Table' ) ) { /** * WP_Privacy_Requests_Table class. + * + * @since 4.9.6 */ abstract class WP_Privacy_Requests_Table extends WP_List_Table { /** * Action name for the requests this table will work with. Classes * which inherit from WP_Privacy_Requests_Table should define this. - * e.g. 'export_personal_data' + * + * Example: 'export_personal_data'. * * @since 4.9.6 * @@ -1039,7 +1043,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * * @since 4.9.6 * - * @param array Array of columns. + * @return array Array of columns. */ public function get_columns() { $columns = array( @@ -1057,7 +1061,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * * @since 4.9.6 * - * @return array + * @return array Default sortable columns. */ protected function get_sortable_columns() { return array(); @@ -1068,7 +1072,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * * @since 4.9.6 * - * @return string + * @return string Default primary column name. */ protected function get_default_primary_column_name() { return 'email'; @@ -1112,12 +1116,11 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { } /** - * Get an associative array ( id => link ) with the list - * of views available on this table. + * Get an associative array ( id => link ) with the list of views available on this table. * * @since 4.9.6 * - * @return array + * @return array Associative array of views in the format of $view_name => $view_markup. */ protected function get_views() { $current_status = isset( $_REQUEST['filter-status'] ) ? sanitize_text_field( $_REQUEST['filter-status'] ) : ''; @@ -1142,7 +1145,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * * @since 4.9.6 * - * @return array + * @return array List of bulk actions. */ protected function get_bulk_actions() { return array( @@ -1256,7 +1259,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * @since 4.9.6 * * @param WP_User_Request $item Item being shown. - * @return string + * @return string Checkbox column markup. */ public function column_cb( $item ) { return sprintf( '', esc_attr( $item->ID ) ); @@ -1268,7 +1271,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * @since 4.9.6 * * @param WP_User_Request $item Item being shown. - * @return string + * @return string Status column markup. */ public function column_status( $item ) { $status = get_post_status( $item->ID ); @@ -1305,7 +1308,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * @since 4.9.6 * * @param int $timestamp Event timestamp. - * @return string + * @return string Human readable date. */ protected function get_timestamp_as_date( $timestamp ) { if ( empty( $timestamp ) ) { @@ -1327,9 +1330,9 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { * * @since 4.9.6 * - * @param WP_User_Request $item Item being shown. + * @param WP_User_Request $item Item being shown. * @param string $column_name Name of column being shown. - * @return string + * @return string Default column output. */ public function column_default( $item, $column_name ) { $cell_value = $item->$column_name; @@ -1342,19 +1345,19 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { } /** - * Actions column. Overriden by children. + * Actions column. Overridden by children. * * @since 4.9.6 * * @param WP_User_Request $item Item being shown. - * @return string + * @return string Email column markup. */ public function column_email( $item ) { return sprintf( '%2$s %3$s', esc_url( 'mailto:' . $item->email ), $item->email, $this->row_actions( array() ) ); } /** - * Next steps column. Overriden by children. + * Next steps column. Overridden by children. * * @since 4.9.6 * @@ -1363,11 +1366,11 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { public function column_next_steps( $item ) {} /** - * Generates content for a single row of the table + * Generates content for a single row of the table, * * @since 4.9.6 * - * @param WP_User_Request $item The current item + * @param WP_User_Request $item The current item. */ public function single_row( $item ) { $status = $item->status; @@ -1378,7 +1381,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { } /** - * Embed scripts used to perform actions. Overriden by children. + * Embed scripts used to perform actions. Overridden by children. * * @since 4.9.6 */ @@ -1415,7 +1418,7 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table { * @since 4.9.6 * * @param WP_User_Request $item Item being shown. - * @return string + * @return string Email column markup. */ public function column_email( $item ) { $exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() ); @@ -1444,7 +1447,7 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table { } /** - * Next steps column. + * Displays the next steps column. * * @since 4.9.6 * @@ -1495,7 +1498,7 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table { /** * WP_Privacy_Data_Removal_Requests_Table class. * - * @since 4.9.6 + * @since 4.9.6 */ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table { /** @@ -1522,7 +1525,7 @@ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table { * @since 4.9.6 * * @param WP_User_Request $item Item being shown. - * @return string + * @return string Email column markup. */ public function column_email( $item ) { $row_actions = array(); diff --git a/wp-includes/user.php b/wp-includes/user.php index 1bf62632ad..566702f4fc 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -2816,7 +2816,7 @@ function new_user_email_admin_notice() { * @since 4.9.6 * @access private * - * @return array + * @return array List of core privacy action types. */ function _wp_privacy_action_request_types() { return array( @@ -3281,7 +3281,7 @@ function wp_create_user_request( $email_address = '', $action_name = '', $reques * @since 4.9.6 * * @param string $action_name Action name of the request. - * @return string + * @return string Human readable action name. */ function wp_user_request_action_description( $action_name ) { switch ( $action_name ) { @@ -3407,7 +3407,7 @@ All at ###SITENAME### * @param array $email_data { * Data relating to the account action email. * - * @type WP_User_Request $request User request object. + * @type WP_User_Request $request User request object. * @type string $email The email address this is being sent to. * @type string $description Description of the action being performed so the user knows what the email is for. * @type string $confirm_url The link to click on to confirm the account action. @@ -3452,7 +3452,7 @@ function wp_generate_user_request_key( $request_id ) { } /** - * Valdate a user request by comparing the key with the request's key. + * Validate a user request by comparing the key with the request's key. * * @since 4.9.6 * diff --git a/wp-includes/version.php b/wp-includes/version.php index 19d2c77632..a64d91ca7a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43251'; +$wp_version = '5.0-alpha-43256'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.