Make WordPress Core

Ticket #43910: 43910.2.diff

File 43910.2.diff, 8.5 KB (added by audrasjb, 7 years ago)

Patch refreshed for 4.9.8 release

  • src/wp-admin/includes/user.php

    diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php
    index fa868d9..085e4cb 100644
    a b function _wp_personal_data_export_page() { 
    808808                <hr class="wp-header-end" />
    809809
    810810                <?php settings_errors(); ?>
     811               
     812                <?php
     813                /**
     814                 * Fires immediately before the personal data export new request form.
     815                 *
     816                 * @since 4.9.8
     817                 */
     818                do_action( 'wp_privacy_personal_data_export_request_form_pre' );
     819                ?>
    811820
    812821                <form method="post" class="wp-privacy-request-form">
    813822                        <h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2>
    function _wp_personal_data_export_page() { 
    822831                        <input type="hidden" name="action" value="add_export_personal_data_request" />
    823832                        <input type="hidden" name="type_of_action" value="export_personal_data" />
    824833                </form>
     834
     835                <?php
     836                /**
     837                 * Fires immediately after the personal data export new request form.
     838                 *
     839                 * @since 4.9.8
     840                 */
     841                do_action( 'wp_privacy_personal_data_export_request_form_after' );
     842                ?>
     843       
    825844                <hr />
    826845
    827846                <?php $requests_table->views(); ?>
    function _wp_personal_data_export_page() { 
    840859                        $requests_table->embed_scripts();
    841860                        ?>
    842861                </form>
     862               
     863                <?php
     864                /**
     865                 * Fires immediately after the personal data export request table.
     866                 *
     867                 * @since 4.9.8
     868                 */
     869                do_action( 'wp_privacy_personal_data_export_request_table_after' );
     870                ?>
     871                       
    843872        </div>
     873
    844874        <?php
     875        /**
     876         * Fires at the bottom of the personal data export page.
     877         *
     878         * @since 4.9.8
     879         */
     880        do_action( 'wp_privacy_personal_data_export_request_page_bottom' );
    845881}
    846882
    847883/**
    function _wp_personal_data_removal_page() { 
    882918
    883919                <?php settings_errors(); ?>
    884920
     921                <?php
     922                /**
     923                 * Fires immediately before the personal data erasure new request form.
     924                 *
     925                 * @since 4.9.8
     926                 */
     927                do_action( 'wp_privacy_personal_data_erase_request_form_pre' );
     928                ?>
     929
    885930                <form method="post" class="wp-privacy-request-form">
    886931                        <h2><?php esc_html_e( 'Add Data Erasure Request' ); ?></h2>
    887932                        <p><?php esc_html_e( 'An email will be sent to the user at this email address asking them to verify the request.' ); ?></p>
    function _wp_personal_data_removal_page() { 
    895940                        <input type="hidden" name="action" value="add_remove_personal_data_request" />
    896941                        <input type="hidden" name="type_of_action" value="remove_personal_data" />
    897942                </form>
     943
     944                <?php
     945                /**
     946                 * Fires immediately after the personal data erasure new request form.
     947                 *
     948                 * @since 4.9.8
     949                 */
     950                do_action( 'wp_privacy_personal_data_erase_request_form_after' );
     951                ?>
     952
    898953                <hr />
    899954
    900955                <?php $requests_table->views(); ?>
    function _wp_personal_data_removal_page() { 
    913968                        $requests_table->embed_scripts();
    914969                        ?>
    915970                </form>
     971
     972                <?php
     973                /**
     974                 * Fires immediately after the personal data erasure request table.
     975                 *
     976                 * @since 4.9.8
     977                 */
     978                do_action( 'wp_privacy_personal_data_erase_request_table_after' );
     979                ?>
     980
    916981        </div>
     982
    917983        <?php
     984        /**
     985         * Fires at the bottom of the personal data erasure page.
     986         *
     987         * @since 4.9.8
     988         */
     989        do_action( 'wp_privacy_personal_data_erase_request_page_bottom' );
    918990}
    919991
    920992/**
    abstract class WP_Privacy_Requests_Table extends WP_List_Table { 
    12361308                        $args['post_status'] = $filter_status;
    12371309                }
    12381310
     1311                /**
     1312                 * Filters the arguments for the requests query in the Privacy Requests list table.
     1313                 *
     1314                 * @since 4.9.8
     1315                 *
     1316                 * @param array $args An array of WP_Query arguments.
     1317                 */
     1318                $args = apply_filters( $this->request_type . '_list_table_query_args', $args );
     1319
    12391320                $requests_query = new WP_Query( $args );
    12401321                $requests       = $requests_query->posts;
    12411322
  • src/wp-admin/privacy.php

    diff --git a/src/wp-admin/privacy.php b/src/wp-admin/privacy.php
    index b9c5d8c..9d67d2a 100644
    a b require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    126126<div class="wrap">
    127127        <h1><?php echo $title; ?></h1>
    128128        <h2><?php _e( 'Privacy Policy page' ); ?></h2>
    129         <p>
    130                 <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a privacy policy.' ); ?>
    131                 <?php _e( 'If you already have a privacy policy page, please select it below. If not, please create one.' ); ?>
    132         </p>
    133         <p>
    134                 <?php _e( 'The new page will include help and suggestions for your privacy policy.' ); ?>
    135                 <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your privacy policy requires, and to keep that information current and accurate.' ); ?>
    136         </p>
    137         <p>
    138                 <?php _e( 'After your privacy policy page is set, we suggest that you edit it.' ); ?>
    139                 <?php _e( 'We would also suggest reviewing your privacy policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?>
    140         </p>
     129
    141130        <?php
     131        /**
     132         * Fires after the heading on the privacy policy (settings) page.
     133         *
     134         * @since 4.9.8
     135         */
     136        do_action( 'wp_privacy_policy_settings_page_heading_after' );
     137
     138        $introduction = array(
     139                array(
     140                        __( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a privacy policy.' ),
     141                        __( 'If you already have a privacy policy page, please select it below. If not, please create one.' ),
     142                ),
     143                array(
     144                        __( 'The new page will include help and suggestions for your privacy policy.' ),
     145                        __( 'However, it is your responsibility to use those resources correctly, to provide the information that your privacy policy requires, and to keep that information current and accurate.' ),
     146                ),
     147                array(
     148                        __( 'After your privacy policy page is set, we suggest that you edit it.' ),
     149                        __( 'We would also suggest reviewing your privacy policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ),     
     150                ),
     151        );
     152
     153        /**
     154         * Filters the introduction text on the privacy policy settings page.
     155         *
     156         * @since 4.9.8
     157         *
     158         * @param array[] $introduction Array of arrays containing introduction paragraphs and sentences.
     159         */
     160        $intro_paragraphs = apply_filters( 'wp_privacy_policy_settings_page_introduction', $introduction );
     161
     162        foreach( (array) $intro_paragraphs as $paragraph ) {
     163                echo '<p>';
     164                echo wp_kses_post( implode( ' ', $paragraph ) );
     165                echo '</p>';
     166        }
    142167
    143168        if ( $privacy_policy_page_exists ) {
    144169                $edit_href = add_query_arg(
    require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    181206                <?php
    182207        }
    183208        ?>
     209
     210        <?php
     211        /**
     212         * Fires after the introductory text on the privacy policy (settings) page.
     213         *
     214         * @since 4.9.8
     215         */
     216        do_action( 'wp_privacy_policy_settings_page_intro_after' );
     217        ?>
     218
    184219        <hr>
    185220        <table class="form-table tools-privacy-policy-page">
     221
     222                <?php
     223                /**
     224                 * Fires before the create/select table row on the privacy policy (settings) page.
     225                 *
     226                 * @since 4.9.8
     227                 */
     228                do_action( 'wp_privacy_policy_settings_page_table_row_pre' );
     229                ?>
     230
    186231                <tr>
    187232                        <th scope="row">
    188233                                <?php
    require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    247292                                </form>
    248293                        </td>
    249294                </tr>
     295
     296                <?php
     297                /**
     298                 * Fires after the create/select table row on the privacy policy (settings) page.
     299                 *
     300                 * @since 4.9.8
     301                 */
     302                do_action( 'wp_privacy_policy_settings_page_table_row_after' );
     303                ?>
     304
    250305        </table>
     306
     307        <?php
     308        /**
     309         * Fires after the create/select table on the privacy policy (settings) page.
     310         *
     311         * @since 4.9.8
     312         */
     313        do_action( 'wp_privacy_policy_settings_page_table_after' );
     314        ?>
     315
    251316</div>
     317
    252318<?php
     319/**
     320 * Fires at the bottom of the privacy policy (settings) page.
     321 *
     322 * @since 4.9.8
     323 */
     324 do_action( 'wp_privacy_policy_settings_page_bottom' );
    253325
    254 include( ABSPATH . 'wp-admin/admin-footer.php' );
     326include( ABSPATH . 'wp-admin/admin-footer.php' );
     327 No newline at end of file
  • src/wp-admin/tools.php

    diff --git a/src/wp-admin/tools.php b/src/wp-admin/tools.php
    index ddb0921..29ee38c 100644
    a b require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    4343<?php
    4444
    4545if ( $is_privacy_guide ) {
     46        /**
     47         * Fires before the privacy policy guide.
     48         *
     49         * @since 4.9.8
     50         */
     51        do_action( 'wp_privacy_policy_guide_pre' );
    4652        ?>
     53
    4754        <div class="wp-privacy-policy-guide">
    4855                <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
    4956        </div>
     57
    5058        <?php
     59        /**
     60         * Fires after the privacy policy guide.
     61         *
     62         * @since 4.9.8
     63         */
     64        do_action( 'wp_privacy_policy_guide_after' );
    5165
    5266} else {
    5367