Changeset 12393
- Timestamp:
- 02/13/2023 05:40:44 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-report-topic.php
r10492 r12393 106 106 wp_add_object_terms( $_POST['wporg-support-report-topic'], 'modlook', 'topic-tag' ); 107 107 108 $reason = $_POST['topic-report-reason']; 109 110 if ( 'other-input' === $reason ) { 111 $reason = $_POST['topic-report-reason-other']; 112 } 108 $reason = sprintf( 109 '%s: %s', 110 $_POST['topic-report-reason'], 111 $_POST['topic-report-reason-details'] 112 ); 113 113 114 114 $this->add_modlook_history( $_POST['wporg-support-report-topic'], $reason ); … … 173 173 174 174 <label for="topic-report-reason"><?php _e( 'Report this topic for:', 'wporg-forums' ); ?></label> 175 <select name="topic-report-reason" id="topic-report-reason" required="required" onchange="wporg_report_topic_change()">175 <select name="topic-report-reason" id="topic-report-reason" required="required"> 176 176 <option value=""><?php _ex( '— Choose one —', 'Report a topic reason', 'wporg-forums' ); ?></option> 177 177 <option><?php _ex( 'Guideline violation', 'Report a topic reason', 'wporg-forums' ); ?></option> … … 181 181 <option value="other-input"><?php _ex( 'Other', 'Report a topic reason', 'wporg-forums' ); ?></option> 182 182 </select> 183 <aside id="report-topic-other" style="display: none;">184 <label for="topic-report-reason- other"><?php _e( 'Your own reason:', 'wporg-forums' ); ?></label>185 <input type="text" name="topic-report-reason- other" id="topic-report-reason-other">183 <aside id="report-topic-other"> 184 <label for="topic-report-reason-details"><?php _e( 'Why are you reporting this topic:', 'wporg-forums' ); ?></label> 185 <input type="text" name="topic-report-reason-details" id="topic-report-reason-details" required="required"> 186 186 </aside> 187 187 <input type="submit" name="submit" value="<?php esc_attr_e( 'Report', 'wporg-forums' ); ?>"> 188 188 </form> 189 190 <script type="text/javascript">191 function wporg_report_topic_change() {192 if ( 'other-input' === document.getElementById('topic-report-reason').value ) {193 document.getElementById( 'report-topic-other' ).style.display = 'block';194 } else {195 document.getElementById( 'report-topic-other' ).style.display = 'none';196 }197 }198 </script>199 189 <?php 200 190 $report_text = ob_get_clean();
Note: See TracChangeset
for help on using the changeset viewer.