Skip to:
Content

Changeset 6513


Ignore:
Timestamp:
06/09/17 19:42:50 (6 months ago)
Author:
johnjamesjacoby
Message:

Tools: Use escaping gettext functions in admin area Reset Tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/tools/reset.php

    r6282 r6513  
    2525    <div class="wrap"> 
    2626        <h1><?php esc_html_e( 'Forum Tools', 'bbpress' ); ?></h1> 
    27         <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Reset Forums', 'bbpress' ) ); ?></h2> 
     27        <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( esc_html__( 'Reset Forums', 'bbpress' ) ); ?></h2> 
    2828        <p><?php esc_html_e( 'Revert your forums back to a brand new installation, as if bbPress were never installed. This process cannot be undone.', 'bbpress' ); ?></p> 
    2929 
     
    106106    // Stores messages 
    107107    $messages = array(); 
    108     $failed   = __( 'Failed!',   'bbpress' ); 
    109     $success  = __( 'Success!', 'bbpress' ); 
     108    $failed   = esc_html__( 'Failed!',  'bbpress' ); 
     109    $success  = esc_html__( 'Success!', 'bbpress' ); 
    110110 
    111111    // Flush the cache; things are about to get ugly. 
     
    120120 
    121121    // Define variables 
    122     $bbp_db    = bbp_db(); 
    123     $statement  = __( 'Deleting Posts&hellip; %s', 'bbpress' ); 
     122    $bbp_db     = bbp_db(); 
     123    $statement  = esc_html__( 'Deleting Posts&hellip; %s', 'bbpress' ); 
    124124 
    125125    $sql_posts  = $bbp_db->get_results( "SELECT `ID` FROM `{$bbp_db->posts}` WHERE `post_type` IN ('{$fpt}', '{$tpt}', '{$rpt}')", OBJECT_K ); 
     
    135135            $sql_meta[] = $key; 
    136136        } 
    137         $statement  = __( 'Deleting Post Meta&hellip; %s', 'bbpress' ); 
     137        $statement  = esc_html__( 'Deleting Post Meta&hellip; %s', 'bbpress' ); 
    138138        $sql_meta   = implode( "', '", $sql_meta ); 
    139139        $sql_delete = "DELETE FROM `{$bbp_db->postmeta}` WHERE `post_id` IN ('{$sql_meta}')"; 
     
    149149            $sql_meta[] = $key; 
    150150        } 
    151         $statement  = __( 'Deleting Post Revisions&hellip; %s', 'bbpress' ); 
     151        $statement  = esc_html__( 'Deleting Post Revisions&hellip; %s', 'bbpress' ); 
    152152        $sql_meta   = implode( "', '", $sql_meta ); 
    153153        $sql_delete = "DELETE FROM `{$bbp_db->posts}` WHERE `post_parent` IN ('{$sql_meta}') AND `post_type` = 'revision'"; 
     
    158158    /** Forum moderators ******************************************************/ 
    159159 
    160     $statement  = __( 'Deleting Forum Moderators&hellip; %s', 'bbpress' ); 
     160    $statement  = esc_html__( 'Deleting Forum Moderators&hellip; %s', 'bbpress' ); 
    161161    $sql_delete = "DELETE a,b,c FROM `{$bbp_db->terms}` AS a LEFT JOIN `{$bbp_db->term_taxonomy}` AS c ON a.term_id = c.term_id LEFT JOIN `{$bbp_db->term_relationships}` AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'forum-mod'"; 
    162162    $result     = is_wp_error( $bbp_db->query( $sql_delete ) ) ? $failed : $success; 
     
    165165    /** Topic Tags ************************************************************/ 
    166166 
    167     $statement  = __( 'Deleting Topic Tags&hellip; %s', 'bbpress' ); 
     167    $statement  = esc_html__( 'Deleting Topic Tags&hellip; %s', 'bbpress' ); 
    168168    $sql_delete = "DELETE a,b,c FROM `{$bbp_db->terms}` AS a LEFT JOIN `{$bbp_db->term_taxonomy}` AS c ON a.term_id = c.term_id LEFT JOIN `{$bbp_db->term_relationships}` AS b ON b.term_taxonomy_id = c.term_taxonomy_id WHERE c.taxonomy = 'topic-tag'"; 
    169169    $result     = is_wp_error( $bbp_db->query( $sql_delete ) ) ? $failed : $success; 
     
    180180                $sql_meta[] = $key; 
    181181            } 
    182             $statement  = __( 'Deleting Imported Users&hellip; %s', 'bbpress' ); 
     182            $statement  = esc_html__( 'Deleting Imported Users&hellip; %s', 'bbpress' ); 
    183183            $sql_meta   = implode( "', '", $sql_meta ); 
    184184            $sql_delete = "DELETE FROM `{$bbp_db->users}` WHERE `ID` IN ('{$sql_meta}')"; 
    185185            $result     = is_wp_error( $bbp_db->query( $sql_delete ) ) ? $failed : $success; 
    186186            $messages[] = sprintf( $statement, $result ); 
    187             $statement  = __( 'Deleting Imported User Meta&hellip; %s', 'bbpress' ); 
     187            $statement  = esc_html__( 'Deleting Imported User Meta&hellip; %s', 'bbpress' ); 
    188188            $sql_delete = "DELETE FROM `{$bbp_db->usermeta}` WHERE `user_id` IN ('{$sql_meta}')"; 
    189189            $result     = is_wp_error( $bbp_db->query( $sql_delete ) ) ? $failed : $success; 
     
    193193 
    194194    // Next, if we still have users that were not imported delete that meta data 
    195     $statement  = __( 'Deleting User Meta&hellip; %s', 'bbpress' ); 
     195    $statement  = esc_html__( 'Deleting User Meta&hellip; %s', 'bbpress' ); 
    196196    $sql_delete = "DELETE FROM `{$bbp_db->usermeta}` WHERE `meta_key` LIKE '%%_bbp_%%'"; 
    197197    $result     = is_wp_error( $bbp_db->query( $sql_delete ) ) ? $failed : $success; 
     
    200200    /** Converter *************************************************************/ 
    201201 
    202     $statement  = __( 'Deleting Conversion Table&hellip; %s', 'bbpress' ); 
     202    $statement  = esc_html__( 'Deleting Conversion Table&hellip; %s', 'bbpress' ); 
    203203    $table_name = $bbp_db->prefix . 'bbp_converter_translator'; 
    204204    if ( $bbp_db->get_var( "SHOW TABLES LIKE '{$table_name}'" ) === $table_name ) { 
     
    212212    /** Options ***************************************************************/ 
    213213 
    214     $statement  = __( 'Deleting Settings&hellip; %s', 'bbpress' ); 
     214    $statement  = esc_html__( 'Deleting Settings&hellip; %s', 'bbpress' ); 
    215215    bbp_delete_options(); 
    216216    $messages[] = sprintf( $statement, $success ); 
     
    218218    /** Roles *****************************************************************/ 
    219219 
    220     $statement  = __( 'Deleting Roles and Capabilities&hellip; %s', 'bbpress' ); 
     220    $statement  = esc_html__( 'Deleting Roles and Capabilities&hellip; %s', 'bbpress' ); 
    221221    bbp_remove_roles(); 
    222222    bbp_remove_caps(); 
Note: See TracChangeset for help on using the changeset viewer.