Changeset 2971
- Timestamp:
- 04/01/2011 01:53:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-general-functions.php
r2970 r2971 847 847 */ 848 848 function bbp_pre_get_posts( $wp_query ) { 849 global $bbp , $wp_version;849 global $bbp; 850 850 851 851 // Bail if $wp_query is empty or of incorrect class … … 885 885 } 886 886 887 / / Confirmed existence of the bbPress user888 889 // Define new query variable887 /** User Exists *******************************************************/ 888 889 // View or edit? 890 890 if ( !empty( $is_edit ) ) { 891 891 892 // Only allow super admins on multisite to edit every user. 892 893 if ( ( is_multisite() && !current_user_can( 'manage_network_users' ) && $user_id != $current_user->ID && !apply_filters( 'enable_edit_any_user_configuration', true ) ) || !current_user_can( 'edit_user', $user->ID ) ) 893 894 wp_die( __( 'You do not have the permission to edit this user.', 'bbpress' ) ); 894 895 896 // We are editing a profile 895 897 $wp_query->bbp_is_user_profile_edit = true; 896 898 897 // Load the required user editing functions899 // Load the core WordPress contact methods 898 900 if ( !function_exists( '_wp_get_user_contactmethods' ) ) 899 901 include_once( ABSPATH . 'wp-includes/registration.php' ); 900 902 903 // Load the edit_user functions 901 904 if ( !function_exists( 'edit_user' ) ) 902 905 require_once( ABSPATH . 'wp-admin/includes/user.php' ); 903 906 907 // We are viewing a profile 904 908 } else { 905 909 $wp_query->bbp_is_user_profile_page = true; … … 925 929 } elseif ( !empty( $bbp_view ) ) { 926 930 927 // Check if the view exists by checking if there are query args are set or not931 // Check if the view exists by checking if there are query args are set 928 932 $view_args = bbp_get_view_query_args( $bbp_view ); 929 933 … … 934 938 } 935 939 940 // We are in a custom topic view 936 941 $wp_query->bbp_is_view = true; 937 942 … … 939 944 } elseif ( !empty( $is_edit ) ) { 940 945 941 // It is a topic edit page946 // We are editing a topic 942 947 if ( get_query_var( 'post_type' ) == bbp_get_topic_post_type() ) 943 948 $wp_query->bbp_is_topic_edit = true; 944 949 945 // It is a reply edit page950 // We are editing a reply 946 951 elseif ( get_query_var( 'post_type' ) == bbp_get_reply_post_type() ) 947 952 $wp_query->bbp_is_reply_edit = true;
Note: See TracChangeset
for help on using the changeset viewer.