Changeset 5688 for trunk/src/templates/default/bbpress-functions.php
- Timestamp:
- 04/19/2015 04:27:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/templates/default/bbpress-functions.php
r5466 r5688 49 49 parent::__construct( bbp_parse_args( $properties, array( 50 50 'id' => 'default', 51 'name' => __( 'bbPress Default', 'bbpress' ),51 'name' => 'bbPress Default', 52 52 'version' => bbp_get_version(), 53 53 'dir' => trailingslashit( bbpress()->themes_dir . 'default' ), … … 241 241 wp_localize_script( 'bbpress-forum', 'bbpForumJS', array( 242 242 'bbp_ajaxurl' => bbp_get_ajax_url(), 243 'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),243 'generic_ajax_error' => esc_html__( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ), 244 244 'is_user_logged_in' => is_user_logged_in(), 245 245 'subs_nonce' => wp_create_nonce( 'toggle-subscription_' . get_the_ID() ) … … 250 250 wp_localize_script( 'bbpress-topic', 'bbpTopicJS', array( 251 251 'bbp_ajaxurl' => bbp_get_ajax_url(), 252 'generic_ajax_error' => __( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ),252 'generic_ajax_error' => esc_html__( 'Something went wrong. Refresh your browser and try again.', 'bbpress' ), 253 253 'is_user_logged_in' => is_user_logged_in(), 254 254 'fav_nonce' => wp_create_nonce( 'toggle-favorite_' . get_the_ID() ), … … 278 278 // Bail if subscriptions are not active 279 279 if ( ! bbp_is_subscriptions_active() ) { 280 bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );280 bbp_ajax_response( false, esc_html__( 'Subscriptions are no longer active.', 'bbpress' ), 300 ); 281 281 } 282 282 283 283 // Bail if user is not logged in 284 284 if ( ! is_user_logged_in() ) { 285 bbp_ajax_response( false, __( 'Please login to subscribe to this forum.', 'bbpress' ), 301 );285 bbp_ajax_response( false, esc_html__( 'Please login to subscribe to this forum.', 'bbpress' ), 301 ); 286 286 } 287 287 … … 292 292 // Bail if user cannot add favorites for this user 293 293 if ( ! current_user_can( 'edit_user', $user_id ) ) { 294 bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );294 bbp_ajax_response( false, esc_html__( 'You do not have permission to do this.', 'bbpress' ), 302 ); 295 295 } 296 296 … … 300 300 // Bail if forum cannot be found 301 301 if ( empty( $forum ) ) { 302 bbp_ajax_response( false, __( 'The forum could not be found.', 'bbpress' ), 303 );302 bbp_ajax_response( false, esc_html__( 'The forum could not be found.', 'bbpress' ), 303 ); 303 303 } 304 304 305 305 // Bail if user did not take this action 306 306 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $forum->ID ) ) { 307 bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );307 bbp_ajax_response( false, esc_html__( 'Are you sure you meant to do that?', 'bbpress' ), 304 ); 308 308 } 309 309 … … 313 313 // Bail if action failed 314 314 if ( empty( $status ) ) { 315 bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );315 bbp_ajax_response( false, esc_html__( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 ); 316 316 } 317 317 … … 346 346 // Bail if favorites are not active 347 347 if ( ! bbp_is_favorites_active() ) { 348 bbp_ajax_response( false, __( 'Favorites are no longer active.', 'bbpress' ), 300 );348 bbp_ajax_response( false, esc_html__( 'Favorites are no longer active.', 'bbpress' ), 300 ); 349 349 } 350 350 351 351 // Bail if user is not logged in 352 352 if ( ! is_user_logged_in() ) { 353 bbp_ajax_response( false, __( 'Please login to make this topic a favorite.', 'bbpress' ), 301 );353 bbp_ajax_response( false, esc_html__( 'Please login to make this topic a favorite.', 'bbpress' ), 301 ); 354 354 } 355 355 … … 360 360 // Bail if user cannot add favorites for this user 361 361 if ( ! current_user_can( 'edit_user', $user_id ) ) { 362 bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );362 bbp_ajax_response( false, esc_html__( 'You do not have permission to do this.', 'bbpress' ), 302 ); 363 363 } 364 364 … … 368 368 // Bail if topic cannot be found 369 369 if ( empty( $topic ) ) { 370 bbp_ajax_response( false, __( 'The topic could not be found.', 'bbpress' ), 303 );370 bbp_ajax_response( false, esc_html__( 'The topic could not be found.', 'bbpress' ), 303 ); 371 371 } 372 372 373 373 // Bail if user did not take this action 374 374 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-favorite_' . $topic->ID ) ) { 375 bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );375 bbp_ajax_response( false, esc_html__( 'Are you sure you meant to do that?', 'bbpress' ), 304 ); 376 376 } 377 377 … … 381 381 // Bail if action failed 382 382 if ( empty( $status ) ) { 383 bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );383 bbp_ajax_response( false, esc_html__( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 ); 384 384 } 385 385 … … 414 414 // Bail if subscriptions are not active 415 415 if ( ! bbp_is_subscriptions_active() ) { 416 bbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );416 bbp_ajax_response( false, esc_html__( 'Subscriptions are no longer active.', 'bbpress' ), 300 ); 417 417 } 418 418 419 419 // Bail if user is not logged in 420 420 if ( ! is_user_logged_in() ) { 421 bbp_ajax_response( false, __( 'Please login to subscribe to this topic.', 'bbpress' ), 301 );421 bbp_ajax_response( false, esc_html__( 'Please login to subscribe to this topic.', 'bbpress' ), 301 ); 422 422 } 423 423 … … 428 428 // Bail if user cannot add favorites for this user 429 429 if ( ! current_user_can( 'edit_user', $user_id ) ) { 430 bbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );430 bbp_ajax_response( false, esc_html__( 'You do not have permission to do this.', 'bbpress' ), 302 ); 431 431 } 432 432 … … 436 436 // Bail if topic cannot be found 437 437 if ( empty( $topic ) ) { 438 bbp_ajax_response( false, __( 'The topic could not be found.', 'bbpress' ), 303 );438 bbp_ajax_response( false, esc_html__( 'The topic could not be found.', 'bbpress' ), 303 ); 439 439 } 440 440 441 441 // Bail if user did not take this action 442 442 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $topic->ID ) ) { 443 bbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );443 bbp_ajax_response( false, esc_html__( 'Are you sure you meant to do that?', 'bbpress' ), 304 ); 444 444 } 445 445 … … 449 449 // Bail if action failed 450 450 if ( empty( $status ) ) { 451 bbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );451 bbp_ajax_response( false, esc_html__( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 ); 452 452 } 453 453
Note: See TracChangeset
for help on using the changeset viewer.