Changeset 4551 for trunk/includes/users/functions.php
- Timestamp:
- 12/06/2012 10:29:35 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/users/functions.php
r4346 r4551 417 417 * Handles the front end adding and removing of favorite topics 418 418 * 419 * @param string $action The requested action to compare this function to 419 420 * @uses bbp_get_user_id() To get the user id 420 421 * @uses bbp_verify_nonce_request() To verify the nonce and check the request … … 431 432 * @uses wp_safe_redirect() To redirect to the url 432 433 */ 433 function bbp_favorites_handler( ) {434 function bbp_favorites_handler( $action = '' ) { 434 435 435 436 if ( !bbp_is_favorites_active() ) 436 437 return false; 437 438 438 // Bail if not a GET action 439 if ( 'GET' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 440 return; 441 442 // Bail if required GET actions aren't passed 443 if ( empty( $_GET['topic_id'] ) || empty( $_GET['action'] ) ) 439 // Bail if no topic ID is passed 440 if ( empty( $_GET['topic_id'] ) ) 444 441 return; 445 442 … … 451 448 452 449 // Bail if actions aren't meant for this function 453 if ( !in_array( $ _GET['action'], $possible_actions ) )450 if ( !in_array( $action, $possible_actions ) ) 454 451 return; 455 452 456 453 // What action is taking place? 457 $action = $_GET['action'];458 454 $topic_id = intval( $_GET['topic_id'] ); 459 455 $user_id = bbp_get_user_id( 0, true, true ); … … 735 731 * Handles the front end subscribing and unsubscribing topics 736 732 * 733 * @param string $action The requested action to compare this function to 737 734 * @uses bbp_is_subscriptions_active() To check if the subscriptions are active 738 735 * @uses bbp_get_user_id() To get the user id … … 751 748 * @uses wp_safe_redirect() To redirect to the url 752 749 */ 753 function bbp_subscriptions_handler( ) {750 function bbp_subscriptions_handler( $action = '' ) { 754 751 755 752 if ( !bbp_is_subscriptions_active() ) 756 753 return false; 757 754 758 // Bail if not a GET action 759 if ( 'GET' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 760 return; 761 762 // Bail if required GET actions aren't passed 763 if ( empty( $_GET['topic_id'] ) || empty( $_GET['action'] ) ) 755 // Bail if no topic ID is passed 756 if ( empty( $_GET['topic_id'] ) ) 764 757 return; 765 758 … … 771 764 772 765 // Bail if actions aren't meant for this function 773 if ( !in_array( $ _GET['action'], $possible_actions ) )766 if ( !in_array( $action, $possible_actions ) ) 774 767 return; 775 768 776 769 // Get required data 777 $action = $_GET['action'];778 770 $user_id = bbp_get_user_id( 0, true, true ); 779 771 $topic_id = intval( $_GET['topic_id'] ); … … 841 833 * Handles the front end user editing 842 834 * 835 * @param string $action The requested action to compare this function to 843 836 * @uses is_multisite() To check if it's a multisite 844 837 * @uses bbp_is_user_home() To check if the user is at home (the display page … … 867 860 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error} 868 861 */ 869 function bbp_edit_user_handler() { 870 871 // Bail if not a POST action 872 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) 873 return; 862 function bbp_edit_user_handler( $action = '' ) { 874 863 875 864 // Bail if action is not 'bbp-update-user' 876 if ( empty( $_POST['action'] ) || ( 'bbp-update-user' !== $_POST['action'] ))865 if ( 'bbp-update-user' !== $action ) 877 866 return; 878 867
Note: See TracChangeset
for help on using the changeset viewer.