Changeset 6143
- Timestamp:
- 12/08/2016 05:05:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/functions.php
r6142 r6143 2253 2253 2254 2254 $is_pending = bbp_is_topic_pending( $r['id'] ); 2255 $retval['status'] = true === $is_pending ? bbp_approve_topic( $r['id'] ) : bbp_unapprove_topic( $r['id'] );2256 $retval['message'] = true === $is_pending ? __( '<strong>ERROR</strong>: There was a problem approving the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem unapproving the topic.', 'bbpress' );2257 2255 $retval['view_all'] = ! $is_pending; 2256 2257 // Toggle 2258 $retval['status'] = ( true === $is_pending ) 2259 ? bbp_approve_topic( $r['id'] ) 2260 : bbp_unapprove_topic( $r['id'] ); 2261 2262 // Feedback 2263 $retval['message'] = ( true === $is_pending ) 2264 ? __( '<strong>ERROR</strong>: There was a problem approving the topic.', 'bbpress' ) 2265 : __( '<strong>ERROR</strong>: There was a problem unapproving the topic.', 'bbpress' ); 2258 2266 2259 2267 break; … … 2263 2271 check_ajax_referer( "close-{$nonce_suffix}" ); 2264 2272 2265 $is_open = bbp_is_topic_open( $r['id'] ); 2266 $retval['status'] = true === $is_open ? bbp_close_topic( $r['id'] ) : bbp_open_topic( $r['id'] ); 2267 $retval['message'] = true === $is_open ? __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'bbpress' ); 2273 $is_open = bbp_is_topic_open( $r['id'] ); 2274 2275 // Toggle 2276 $retval['status'] = ( true === $is_open ) 2277 ? bbp_close_topic( $r['id'] ) 2278 : bbp_open_topic( $r['id'] ); 2279 2280 // Feedback 2281 $retval['message'] = ( true === $is_open ) 2282 ? __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'bbpress' ) 2283 : __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'bbpress' ); 2268 2284 2269 2285 break; … … 2273 2289 check_ajax_referer( "stick-{$nonce_suffix}" ); 2274 2290 2275 $is_sticky = bbp_is_topic_sticky( $r['id'] ); 2276 $is_super = false === $is_sticky && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false; 2277 $retval['status'] = true === $is_sticky ? bbp_unstick_topic( $r['id'] ) : bbp_stick_topic( $r['id'], $is_super ); 2278 $retval['message'] = true === $is_sticky ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' ); 2291 $is_sticky = bbp_is_topic_sticky( $r['id'] ); 2292 $is_super = false === $is_sticky && ! empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false; 2293 2294 // Toggle 2295 $retval['status'] = ( true === $is_sticky ) 2296 ? bbp_unstick_topic( $r['id'] ) 2297 : bbp_stick_topic( $r['id'], $is_super ); 2298 2299 // Feedback 2300 $retval['message'] = ( true === $is_sticky ) 2301 ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) 2302 : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' ); 2279 2303 2280 2304 break; … … 2285 2309 2286 2310 $is_spam = bbp_is_topic_spam( $r['id'] ); 2287 $retval['status'] = true === $is_spam ? bbp_unspam_topic( $r['id'] ) : bbp_spam_topic( $r['id'] );2288 $retval['message'] = true === $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );2289 2311 $retval['view_all'] = ! $is_spam; 2312 2313 // Toggle 2314 $retval['status'] = ( true === $is_spam ) 2315 ? bbp_unspam_topic( $r['id'] ) 2316 : bbp_spam_topic( $r['id'] ); 2317 2318 // Feedback 2319 $retval['message'] = ( true === $is_spam ) 2320 ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) 2321 : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' ); 2290 2322 2291 2323 break; … … 2298 2330 check_ajax_referer( "trash-{$nonce_suffix}" ); 2299 2331 2300 $ view_all= true;2301 $retval['status'] = wp_trash_post( $r['id'] );2302 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem trashing the topic.', 'bbpress' );2332 $retval['view_all'] = true; 2333 $retval['status'] = wp_trash_post( $r['id'] ); 2334 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem trashing the topic.', 'bbpress' ); 2303 2335 2304 2336 break;
Note: See TracChangeset
for help on using the changeset viewer.