Making WordPress.org


Ignore:
Timestamp:
08/10/2022 05:03:34 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Improve consistency of various error messages.

  • Use sentence case for the word Error, instead of all caps. Using all caps should be avoided for better readability and because screen readers may pronounce all-caps words as abbreviations.
  • Move the colon of the Error: prefix inside the <strong> tags.

This matches similar changes in WordPress core.

Follow-up to [WP47156], [WP53118], [WP53337], [WP53458], [3702], [3719], [3797], [3937], [4043], [11301], [11382], [11383], [11580].

Props NekoJonez.
Fixes #6309.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php

    r10660 r12012  
    316316        // Check for empty post id.
    317317        if ( ! $post ) {
    318             bbp_add_error( 'wporg_bbp_archive_post_id', __( '<strong>ERROR</strong>: No post was found! Which post are you archiving?', 'wporg-forums' ) );
     318            bbp_add_error( 'wporg_bbp_archive_post_id', __( '<strong>Error:</strong> No post was found! Which post are you archiving?', 'wporg-forums' ) );
    319319
    320320        // Check for current user.
    321321        } elseif ( empty( $user_id ) ) {
    322             bbp_add_error( 'wporg_bbp_archive_logged_in', __( '<strong>ERROR</strong>: You must be logged in to do this!', 'wporg-forums' ) );
     322            bbp_add_error( 'wporg_bbp_archive_logged_in', __( '<strong>Error:</strong> You must be logged in to do this!', 'wporg-forums' ) );
    323323
    324324        // Check nonce.
    325325        } elseif ( ! bbp_verify_nonce_request( 'toggle-post-archive_' . $user_id . '_' . $post->ID ) ) {
    326             bbp_add_error( 'wporg_bbp_archive_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'wporg-forums' ) );
     326            bbp_add_error( 'wporg_bbp_archive_nonce', __( '<strong>Error:</strong> Are you sure you wanted to do that?', 'wporg-forums' ) );
    327327
    328328        }
     
    351351            bbp_redirect( $permalink );
    352352        } elseif ( true === $is_archived && 'wporg_bbp_archive_post' === $action ) {
    353             bbp_add_error( 'wporg_bbp_archive_post', __( '<strong>ERROR</strong>: There was a problem archiving that post!', 'wporg-forums' ) );
     353            bbp_add_error( 'wporg_bbp_archive_post', __( '<strong>Error:</strong> There was a problem archiving that post!', 'wporg-forums' ) );
    354354        } elseif ( false === $is_archived && 'wporg_bbp_unarchive_post' === $action ) {
    355             bbp_add_error( 'wporg_bbp_unarchive_post', __( '<strong>ERROR</strong>: There was a problem unarchiving that post!', 'wporg-forums' ) );
     355            bbp_add_error( 'wporg_bbp_unarchive_post', __( '<strong>Error:</strong> There was a problem unarchiving that post!', 'wporg-forums' ) );
    356356        }
    357357    }
     
    712712        $topic = bbp_get_topic( $topic_id );
    713713        if ( empty( $topic ) ) {
    714             bbp_add_error( 'bbp_toggle_topic_missing', __( '<strong>ERROR:</strong> This topic could not be found or no longer exists.', 'wporg-forums' ) );
     714            bbp_add_error( 'bbp_toggle_topic_missing', __( '<strong>Error:</strong> This topic could not be found or no longer exists.', 'wporg-forums' ) );
    715715            return;
    716716        }
     
    718718        // What is the user doing here?
    719719        if ( ! current_user_can( 'edit_topic', $topic_id ) ) {
    720             bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>ERROR:</strong> You do not have permission to do that.', 'wporg-forums' ) );
     720            bbp_add_error( 'bbp_toggle_topic_permission', __( '<strong>Error:</strong> You do not have permission to do that.', 'wporg-forums' ) );
    721721            return;
    722722        }
     
    776776        $reply = bbp_get_reply( $reply_id );
    777777        if ( empty( $reply ) ) {
    778             bbp_add_error( 'bbp_toggle_reply_missing', __( '<strong>ERROR:</strong> This reply could not be found or no longer exists.', 'wporg-forums' ) );
     778            bbp_add_error( 'bbp_toggle_reply_missing', __( '<strong>Error:</strong> This reply could not be found or no longer exists.', 'wporg-forums' ) );
    779779            return;
    780780        }
     
    782782        // What is the user doing here?
    783783        if ( ! current_user_can( 'edit_reply', $reply_id ) ) {
    784             bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>ERROR:</strong> You do not have permission to do that.', 'wporg-forums' ) );
     784            bbp_add_error( 'bbp_toggle_reply_permission', __( '<strong>Error:</strong> You do not have permission to do that.', 'wporg-forums' ) );
    785785            return;
    786786        }
     
    840840                if ( bbp_is_topic_open( $r['id'] ) ) {
    841841                    $retval['status']  = bbp_close_topic( $r['id'] );
    842                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'wporg-forums' );
     842                    $retval['message'] = __( '<strong>Error:</strong> There was a problem closing the topic.', 'wporg-forums' );
    843843                }
    844844
     
    850850                if ( ! bbp_is_topic_open( $r['id'] ) ) {
    851851                    $retval['status']  = bbp_open_topic( $r['id'] );
    852                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'wporg-forums' );
     852                    $retval['message'] = __( '<strong>Error:</strong> There was a problem opening the topic.', 'wporg-forums' );
    853853                }
    854854
     
    860860                if ( ! bbp_is_topic_sticky( $r['id'] ) ) {
    861861                    $retval['status']  = bbp_stick_topic( $r['id'], ! empty( $_GET['super'] ) );
    862                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'wporg-forums' );
     862                    $retval['message'] = __( '<strong>Error:</strong> There was a problem sticking the topic.', 'wporg-forums' );
    863863                }
    864864
     
    870870                if ( bbp_is_topic_sticky( $r['id'] ) ) {
    871871                    $retval['status']  = bbp_unstick_topic( $r['id'] );
    872                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'wporg-forums' );
     872                    $retval['message'] = __( '<strong>Error:</strong> There was a problem unsticking the topic.', 'wporg-forums' );
    873873                }
    874874
     
    880880                if ( ! bbp_is_topic_spam( $r['id'] ) ) {
    881881                    $retval['status']  = bbp_spam_topic( $r['id'] );
    882                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'wporg-forums' );
     882                    $retval['message'] = __( '<strong>Error:</strong> There was a problem marking the topic as spam.', 'wporg-forums' );
    883883                }
    884884                $retval['view_all'] = true;
     
    891891                if ( bbp_is_topic_spam( $r['id'] ) ) {
    892892                    $retval['status']  = bbp_unspam_topic( $r['id'] );
    893                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'wporg-forums' );
     893                    $retval['message'] = __( '<strong>Error:</strong> There was a problem unmarking the topic as spam.', 'wporg-forums' );
    894894                }
    895895                $retval['view_all'] = false;
     
    902902                if ( ! bbp_is_topic_pending( $r['id'] ) ) {
    903903                    $retval['status']  = bbp_unapprove_topic( $r['id'] );
    904                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem unapproving the topic.', 'wporg-forums' );
     904                    $retval['message'] = __( '<strong>Error:</strong> There was a problem unapproving the topic.', 'wporg-forums' );
    905905                }
    906906                $retval['view_all'] = true;
     
    913913                if ( bbp_is_topic_pending( $r['id'] ) ) {
    914914                    $retval['status']  = bbp_approve_topic( $r['id'] );
    915                     $retval['message'] = __( '<strong>ERROR</strong>: There was a problem approving the topic.', 'wporg-forums' );
     915                    $retval['message'] = __( '<strong>Error:</strong> There was a problem approving the topic.', 'wporg-forums' );
    916916                }
    917917                $retval['view_all'] = false;
     
    953953                if ( ! bbp_is_reply_spam( $r['id'] ) ) {
    954954                    $retval['status']   = bbp_spam_reply( $r['id'] );
    955                     $retval['message']  = __( '<strong>ERROR</strong>: There was a problem marking the reply as spam.', 'wporg-forums' );
     955                    $retval['message']  = __( '<strong>Error:</strong> There was a problem marking the reply as spam.', 'wporg-forums' );
    956956                }
    957957                $retval['view_all'] = true;
     
    964964                if ( bbp_is_reply_spam( $r['id'] ) ) {
    965965                    $retval['status']   = bbp_unspam_reply( $r['id'] );
    966                     $retval['message']  = __( '<strong>ERROR</strong>: There was a problem unmarking the reply as spam.', 'wporg-forums' );
     966                    $retval['message']  = __( '<strong>Error:</strong> There was a problem unmarking the reply as spam.', 'wporg-forums' );
    967967                }
    968968                $retval['view_all'] = false;
     
    975975                if ( ! bbp_is_reply_pending( $r['id'] ) ) {
    976976                    $retval['status']   = bbp_unapprove_reply( $r['id'] );
    977                     $retval['message']  = __( '<strong>ERROR</strong>: There was a problem unapproving the reply.', 'wporg-forums' );
     977                    $retval['message']  = __( '<strong>Error:</strong> There was a problem unapproving the reply.', 'wporg-forums' );
    978978                }
    979979                $retval['view_all'] = true;
     
    986986                if ( bbp_is_reply_pending( $r['id'] ) ) {
    987987                    $retval['status']   = bbp_approve_reply( $r['id'] );
    988                     $retval['message']  = __( '<strong>ERROR</strong>: There was a problem approving the reply.', 'wporg-forums' );
     988                    $retval['message']  = __( '<strong>Error:</strong> There was a problem approving the reply.', 'wporg-forums' );
    989989                }
    990990                $retval['view_all'] = false;
Note: See TracChangeset for help on using the changeset viewer.