WordPress.org

Make WordPress Core

Ticket #44383: 44383.1.diff

File 44383.1.diff, 7.3 KB (added by zsiderov, 14 months ago)
  • src/wp-admin/includes/media.php

    diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
    index c941e62..00ed504 100644
    a b function media_buttons( $editor_id = 'content' ) { 
    620620         *
    621621         * @param string $string Media buttons context. Default empty.
    622622         */
    623         $legacy_filter = apply_filters( 'media_buttons_context', '' );
     623        $legacy_filter = apply_filters_deprecated( 'media_buttons_context', array(), '3.5.0', false, __( 'Please use "media_buttons" action instead.' ) );
    624624
    625625        if ( $legacy_filter ) {
    626626                // #WP22559. Close <a> if a plugin started by closing <a> to open their own <a> tag.
  • src/wp-admin/privacy.php

    diff --git a/src/wp-admin/privacy.php b/src/wp-admin/privacy.php
    index 9c360dd..b9c5d8c 100644
    a b require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    155155                <p class="tools-privacy-edit"><strong>
    156156                        <?php
    157157
    158                         /* translators: 1: URL to edit page, 2: URL to view page */
    159                         printf( __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), $edit_href, $view_href );
     158                        if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) {
     159                                /* translators: 1: URL to edit page, 2: URL to view page */
     160                                printf( __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), $edit_href, $view_href );
     161                        } else {
     162                                /* translators: 1: URL to edit page, 2: URL to preview page */
     163                                printf( __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your privacy policy page content.' ), $edit_href, $view_href );
     164                        }
    160165
    161166                        ?>
    162167                </strong></p>
  • src/wp-includes/comment-template.php

    diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
    index f7626f5..649f29a 100644
    a b function comment_form( $args = array(), $post_id = null ) { 
    22622262        $req      = get_option( 'require_name_email' );
    22632263        $html_req = ( $req ? " required='required'" : '' );
    22642264        $html5    = 'html5' === $args['format'];
    2265         $consent  = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
    22662265        $fields   = array(
    22672266                'author'  => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
    22682267                                         '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $html_req . ' /></p>',
    function comment_form( $args = array(), $post_id = null ) { 
    22702269                                         '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $html_req . ' /></p>',
    22712270                'url'     => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
    22722271                                         '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
    2273                 'cookies' => '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
    2274                                          '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>',
    22752272        );
    22762273
     2274        if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) ) {
     2275                $consent           = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
     2276                $fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' .
     2277                                                         '<label for="wp-comment-cookies-consent">' . __( 'Save my name, email, and website in this browser for the next time I comment.' ) . '</label></p>';
     2278        }
     2279
    22772280        $required_text = sprintf( ' ' . __( 'Required fields are marked %s' ), '<span class="required">*</span>' );
    22782281
    22792282        /**
  • src/wp-includes/user.php

    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index 73c3f3c..3d940e1 100644
    a b function _wp_privacy_send_request_confirmation_notification( $request_id ) { 
    29732973                return;
    29742974        }
    29752975
    2976         $subject = sprintf(
    2977                 /* translators: %s Site name. */
    2978                 __( '[%s] Action Confirmed' ),
    2979                 wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
    2980         );
    2981 
    29822976        $manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
    29832977
    29842978        /**
    All at ###SITENAME### 
    30493043         *     @type string          $manage_url  The link to click manage privacy requests of this type.
    30503044         *     @type string          $sitename    The site name sending the mail.
    30513045         *     @type string          $siteurl     The site URL sending the mail.
     3046         *     @type string          $admin_email The administrator email receiving the mail.
    30523047         * }
    30533048         */
    30543049        $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
    All at ###SITENAME### 
    30593054        $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
    30603055        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    30613056
     3057        $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     3058
     3059        $subject = sprintf(
     3060                /* translators: %s Site name. */
     3061                __( '[%s] Action Confirmed' ),
     3062                $blogname
     3063        );
     3064
     3065        /**
     3066         * Filters the subject of the user request confirmation email.
     3067         *
     3068         * @since 4.9.7
     3069         *
     3070         * @param string $subject    The email subject.
     3071         * @param string $blogname   The name of the site.
     3072         * @param array  $email_data {
     3073         *     Data relating to the account action email.
     3074         *
     3075         *     @type WP_User_Request $request     User request object.
     3076         *     @type string          $user_email  The email address confirming a request
     3077         *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3078         *     @type string          $manage_url  The link to click manage privacy requests of this type.
     3079         *     @type string          $sitename    The site name sending the mail.
     3080         *     @type string          $siteurl     The site URL sending the mail.
     3081         *     @type string          $admin_email The administrator email receiving the mail.
     3082         * }
     3083         */
     3084        $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $blogname, $email_data );
     3085
    30623086        $email_sent = wp_mail( $email_data['admin_email'], $subject, $content );
    30633087
    30643088        if ( $email_sent ) {
  • tests/phpunit/tests/comment.php

    diff --git a/tests/phpunit/tests/comment.php b/tests/phpunit/tests/comment.php
    index 7f63c62..a1e3fb3 100644
    a b class Tests_Comment extends WP_UnitTestCase { 
    11561156                $this->assertSame( $expected['comment_agent'], $actual['data'][0]['data'][4]['value'] );
    11571157                $this->assertSame( $expected['comment_date'], $actual['data'][0]['data'][5]['value'] );
    11581158                $this->assertSame( $expected['comment_content'], $actual['data'][0]['data'][6]['value'] );
    1159                 $this->assertSame( get_comment_link( $comment_id ), strip_tags( $actual['data'][0]['data'][7]['value'] ) );
     1159                $this->assertSame( esc_html( get_comment_link( $comment_id ) ), strip_tags( $actual['data'][0]['data'][7]['value'] ) );
    11601160        }
    11611161
    11621162        /**