Ticket #5365: 5365.diff
File 5365.diff, 1.7 KB (added by , 11 years ago) |
---|
-
bp-members/bp-members-admin.php
198 198 $css = apply_filters( 'bp_members_admin_css', $css ); 199 199 wp_enqueue_style( 'bp-members-css', $css, array(), bp_get_version() ); 200 200 201 $js = $this->js_url . "admin{$min}.js"; 202 $js = apply_filters( 'bp_members_admin_js', $js ); 203 wp_enqueue_script( 'bp-members-js', $js, array( 'jquery' ), bp_get_version(), true ); 201 // Only load javascript for BuddyPress profile 202 if ( get_current_screen()->id == $this->user_page ) { 203 $js = $this->js_url . "admin{$min}.js"; 204 $js = apply_filters( 'bp_members_admin_js', $js ); 205 wp_enqueue_script( 'bp-members-js', $js, array( 'jquery' ), bp_get_version(), true ); 206 } 204 207 205 208 // Plugins may want to hook here to load some css/js 206 209 do_action( 'bp_members_admin_enqueue_scripts', get_current_screen()->id, $this->screen_id ); … … 286 289 wp_die( __( 'No users were found', 'buddypress' ) ); 287 290 } 288 291 292 // only edit others profile 293 if ( get_current_user_id() == $user_id ) { 294 bp_core_redirect( get_edit_user_link( $user_id ) ); 295 } 296 289 297 // Build redirection URL 290 298 $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'spam', 'ham', 'delete_avatar' ), $_SERVER['REQUEST_URI'] ); 291 299 $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : false; … … 663 671 * @return array Merged actions. 664 672 */ 665 673 public function row_actions( $actions = '', $user = null ) { 674 // only edit others profile 675 if ( get_current_user_id() == $user->ID ){ 676 return $actions; 677 } 666 678 667 679 $edit_profile = add_query_arg( array( 668 680 'user_id' => $user->ID,