Skip to content

Commit

Permalink
Use esc_html__
Browse files Browse the repository at this point in the history
  • Loading branch information
spacedmonkey committed Dec 1, 2023
1 parent 138ed64 commit 83a5900
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ function rest_oauth1_profile_messages() {
}

if ( ! empty( $_GET['rest_oauth1_revoked'] ) ) {
printf( '<div id="message" class="updated"><p>%s</p></div>', esc_html( __( 'Token revoked.', 'rest_oauth1' ) ) );
printf( '<div id="message" class="updated"><p>%s</p></div>', esc_html__( 'Token revoked.', 'rest_oauth1' ) );
}
if ( ! empty( $_GET['rest_oauth1_revocation_failed'] ) ) {
printf( '<div id="message" class="updated"><p>%s</p></div>', esc_html( __( 'Unable to revoke token.', 'rest_oauth1' ) ) );
printf( '<div id="message" class="updated"><p>%s</p></div>', esc_html__( 'Unable to revoke token.', 'rest_oauth1' ) );
}
}

Expand Down
16 changes: 8 additions & 8 deletions lib/class-wp-rest-oauth1-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected static function handle_edit_submit( $consumer ) {
*/
public static function render_edit_page() {
if ( ! current_user_can( 'edit_users' ) ) {
wp_die( esc_html( __( 'You do not have permission to access this page.', 'rest_oauth1' ) ) );
wp_die( esc_html__( 'You do not have permission to access this page.', 'rest_oauth1' ) );
}

// Are we editing?
Expand All @@ -251,7 +251,7 @@ public static function render_edit_page() {
}

if ( empty( $consumer ) ) {
wp_die( esc_html( __( 'Invalid consumer ID.', 'rest_oauth1' ) ) );
wp_die( esc_html__( 'Invalid consumer ID.', 'rest_oauth1' ) );
}

$form_action = self::get_url(
Expand Down Expand Up @@ -426,8 +426,8 @@ public static function handle_delete() {
wp_die(
sprintf(
'<h1>%s</h1><p>%s</p>',
esc_html( __( 'You are not allowed to delete this application.', 'rest_oauth1' ) ),
esc_html( __( 'An error has occurred.', 'rest_oauth1' ) )
esc_html__( 'You are not allowed to delete this application.', 'rest_oauth1' ),
esc_html__( 'An error has occurred.', 'rest_oauth1' )
),
'',
array( 'response' => (int) $code )
Expand All @@ -444,8 +444,8 @@ public static function handle_delete() {
wp_die(
sprintf(
'<h1>%s</h1><p>%s</p>',
esc_html( __( 'An error has occurred.', 'rest_oauth1' ) ),
esc_html( __( 'Invalid consumer ID', 'rest_oauth1' ) )
esc_html__( 'An error has occurred.', 'rest_oauth1' ),
esc_html__( 'Invalid consumer ID', 'rest_oauth1' )
),
'',
array( 'response' => (int) $code )
Expand All @@ -472,8 +472,8 @@ public static function handle_regenerate() {
wp_die(
sprintf(
'<h1>%s</h1><p>%s</p>',
esc_html( __( 'An error has occurred.', 'rest_oauth1' ) ),
esc_html( __( 'You are not allowed to edit this application.', 'rest_oauth1' ) )
esc_html__( 'An error has occurred.', 'rest_oauth1' ),
esc_html__( 'You are not allowed to edit this application.', 'rest_oauth1' )
),
'',
array( 'response' => (int) $code )
Expand Down

0 comments on commit 83a5900

Please sign in to comment.