Changeset 6750
- Timestamp:
- 12/05/2017 09:18:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/tools/reset.php
r6573 r6750 77 77 78 78 /** 79 * Handle the processing and feedback of the admin tools page79 * Handle a bbPress admin area reset request. 80 80 * 81 81 * @since 2.0.0 bbPress (r2613) … … 83 83 function bbp_admin_reset_handler() { 84 84 85 // Bail if not resetting 85 // Bail if not resetting. 86 86 if ( ! bbp_is_post_request() || empty( $_POST['bbpress-are-you-sure'] ) ) { 87 87 return; 88 88 } 89 89 90 // Only keymasters can proceed 90 // Only keymasters can proceed. 91 91 if ( ! bbp_is_user_keymaster() ) { 92 92 return; 93 93 } 94 94 95 // Bail if not referred from resetter 95 96 check_admin_referer( 'bbpress-reset' ); 96 97 97 // Stores messages 98 // Reset all of bbPress 99 bbp_admin_reset_database(); 100 } 101 102 /** 103 * Perform a bbPress database reset. 104 * 105 * @since 2.6.0 bbPress 106 */ 107 function bbp_admin_reset_database() { 108 109 // Stores messages. 98 110 $messages = array(); 99 111 $failed = esc_html__( 'Failed!', 'bbpress' ); … … 105 117 /** Posts *****************************************************************/ 106 118 107 // Post types and status 119 // Post types and status. 108 120 $fpt = bbp_get_forum_post_type(); 109 121 $tpt = bbp_get_topic_post_type(); 110 122 $rpt = bbp_get_reply_post_type(); 111 123 112 // Define variables 124 // Define variables. 113 125 $bbp_db = bbp_db(); 114 126 $statement = esc_html__( 'Deleting Posts… %s', 'bbpress' );
Note: See TracChangeset
for help on using the changeset viewer.