diff --git a/src/bp-members/bp-members-admin.php b/src/bp-members/bp-members-admin.php
index 2042498..a78cc3b 100644
|
a
|
b
|
class BP_Members_Admin {
|
| 552 | 552 | |
| 553 | 553 | $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; |
| 554 | 554 | $css = $this->css_url . "admin{$min}.css"; |
| | 555 | |
| | 556 | /** |
| | 557 | * Filters the css url to enqueue in the Members admin area. |
| | 558 | * |
| | 559 | * This filter is a variable filter that is dependent on if SCRIPT_DEBUG |
| | 560 | * is defined and set to true. If not, the css file will have '.min' in |
| | 561 | * the file name. |
| | 562 | * |
| | 563 | * @since BuddyPress (2.0.0) |
| | 564 | * |
| | 565 | * @param string $css URL to the CSS admin file to load. |
| | 566 | */ |
| 555 | 567 | $css = apply_filters( 'bp_members_admin_css', $css ); |
| 556 | 568 | |
| 557 | 569 | wp_enqueue_style( 'bp-members-css', $css, array(), bp_get_version() ); |
| … |
… |
class BP_Members_Admin {
|
| 564 | 576 | // Only load javascript for BuddyPress profile |
| 565 | 577 | if ( get_current_screen()->id == $this->user_page ) { |
| 566 | 578 | $js = $this->js_url . "admin{$min}.js"; |
| | 579 | |
| | 580 | /** |
| | 581 | * Filters the js url to enqueue in the Members admin area. |
| | 582 | * |
| | 583 | * This filter is a variable filter that is dependent on if SCRIPT_DEBUG |
| | 584 | * is defined and set to true. If not, the js file will have '.min' in |
| | 585 | * the file name. |
| | 586 | * |
| | 587 | * @since BuddyPress (2.0.0) |
| | 588 | * |
| | 589 | * @param string $js URL to the JavaScript admin file to load. |
| | 590 | */ |
| 567 | 591 | $js = apply_filters( 'bp_members_admin_js', $js ); |
| 568 | 592 | wp_enqueue_script( 'bp-members-js', $js, array( 'jquery' ), bp_get_version(), true ); |
| 569 | 593 | } |
| 570 | 594 | |
| 571 | | // Plugins may want to hook here to load some css/js |
| | 595 | /** |
| | 596 | * Fires after all of the members javascript and css is enqueued. |
| | 597 | * |
| | 598 | * @since BuddyPress (2.0.0) |
| | 599 | * |
| | 600 | * @param string $id ID of the current screen. |
| | 601 | * @param array $screen_id Array of allowed screens to add scripts and styles to. |
| | 602 | */ |
| 572 | 603 | do_action( 'bp_members_admin_enqueue_scripts', get_current_screen()->id, $this->screen_id ); |
| 573 | 604 | } |
| 574 | 605 | |
| … |
… |
class BP_Members_Admin {
|
| 659 | 690 | } |
| 660 | 691 | } |
| 661 | 692 | |
| 662 | | // Call an action for plugins to hook in early |
| | 693 | /** |
| | 694 | * Fires at the start of the signups admin load. |
| | 695 | * |
| | 696 | * @since BuddyPress (2.0.0) |
| | 697 | * |
| | 698 | * @param string $doaction Current bulk action being processed. |
| | 699 | * @param array $_REQUEST Current $_REQUEST global. |
| | 700 | */ |
| 663 | 701 | do_action_ref_array( 'bp_members_admin_load', array( $doaction, $_REQUEST ) ); |
| 664 | 702 | |
| 665 | | // Allowed actions |
| | 703 | /** |
| | 704 | * Filters the allowed actions for use in the user admin page. |
| | 705 | * |
| | 706 | * @since BuddyPress (2.0.0) |
| | 707 | * |
| | 708 | * @param array $value Array of allowed actions to use. |
| | 709 | */ |
| 666 | 710 | $allowed_actions = apply_filters( 'bp_members_admin_allowed_actions', array( 'update', 'delete_avatar', 'spam', 'ham' ) ); |
| 667 | 711 | |
| 668 | 712 | // Prepare the display of the Community Profile screen |
| … |
… |
class BP_Members_Admin {
|
| 700 | 744 | $this->stats_metabox->priority = 'core'; |
| 701 | 745 | |
| 702 | 746 | /** |
| 703 | | * xProfile Hooks to load the profile fields if component is active |
| 704 | | * Plugins should not use this hook, please use 'bp_members_admin_user_metaboxes' instead |
| | 747 | * Fires before loading the profile fields if component is active. |
| | 748 | * |
| | 749 | * Plugins should not use this hook, please use 'bp_members_admin_user_metaboxes' instead. |
| | 750 | * |
| | 751 | * @since BuddyPress (2.0.0) |
| | 752 | * |
| | 753 | * @param int $user_id Current user ID for the screen. |
| | 754 | * @param string $id Current screen ID. |
| | 755 | * @param object $stats_metabox Object holding position data for use with the stats metabox. |
| 705 | 756 | */ |
| 706 | 757 | do_action_ref_array( 'bp_members_admin_xprofile_metabox', array( $user_id, get_current_screen()->id, $this->stats_metabox ) ); |
| 707 | 758 | |
| … |
… |
class BP_Members_Admin {
|
| 736 | 787 | } |
| 737 | 788 | |
| 738 | 789 | /** |
| 739 | | * Custom metabox ? |
| 740 | | * Plugins can restrict metabox to "bp_moderate" admins checking |
| 741 | | * the first argument ($this->is_self_profile) is false in their hook |
| 742 | | * They can also restruct their metabox to self profile editing |
| 743 | | * by cheking it set to true. |
| | 790 | * Fires at the end of the Community Profile screen. |
| | 791 | * |
| | 792 | * Plugins can restrict metabox to "bp_moderate" admins by checking if |
| | 793 | * the first argument ($this->is_self_profile) is false in their callback. |
| | 794 | * They can also restrict their metabox to self profile editing |
| | 795 | * by setting it to true. |
| | 796 | * |
| | 797 | * @since BuddyPress (2.0.0) |
| | 798 | * |
| | 799 | * @param bool $is_self_profile Whether or not it is the current user's profile. |
| | 800 | * @param int $user_id Current user ID. |
| 744 | 801 | */ |
| 745 | 802 | do_action( 'bp_members_admin_user_metaboxes', $this->is_self_profile, $user_id ); |
| 746 | 803 | |
| … |
… |
class BP_Members_Admin {
|
| 765 | 822 | } else { |
| 766 | 823 | $this->redirect = $redirect_to; |
| 767 | 824 | |
| | 825 | /** |
| | 826 | * Fires at the end of the user profile admin load if the doaction |
| | 827 | * does not match any available actions. |
| | 828 | * |
| | 829 | * @since BuddyPress (2.0.0) |
| | 830 | * |
| | 831 | * @param string $doaction Current bulk action being processed. |
| | 832 | * @param int $user_id Current user ID. |
| | 833 | * @param array $_REQUEST Current $_REQUEST global. |
| | 834 | * @param string $redirect Determined redirect url to send user to. |
| | 835 | */ |
| 768 | 836 | do_action_ref_array( 'bp_members_admin_update_user', array( $doaction, $user_id, $_REQUEST, $this->redirect ) ); |
| 769 | 837 | |
| 770 | 838 | bp_core_redirect( $this->redirect ); |
| … |
… |
class BP_Members_Admin {
|
| 1005 | 1073 | <?php |
| 1006 | 1074 | // Loading other stats only if user has activated their account |
| 1007 | 1075 | if ( empty( $user->user_status ) ) { |
| | 1076 | |
| | 1077 | /** |
| | 1078 | * Fires in the user stats metabox if the user has activated their account. |
| | 1079 | |
| | 1080 | * @since BuddyPress (2.0.0) |
| | 1081 | * |
| | 1082 | * @param array $value Array holding the user ID. |
| | 1083 | * @param object $user Current displayed user object. |
| | 1084 | */ |
| 1008 | 1085 | do_action( 'bp_members_admin_user_stats', array( 'user_id' => $user->ID ), $user ); |
| 1009 | 1086 | } |
| 1010 | 1087 | ?> |
| … |
… |
class BP_Members_Admin {
|
| 1315 | 1392 | $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'activated', 'notactivated', 'deleted', 'notdeleted', 'resent', 'notresent', 'do_delete', 'do_resend', 'do_activate', '_wpnonce', 'signup_ids' ), $_SERVER['REQUEST_URI'] ); |
| 1316 | 1393 | $doaction = bp_admin_list_table_current_bulk_action(); |
| 1317 | 1394 | |
| 1318 | | // Call an action for plugins to hook in early |
| | 1395 | /** |
| | 1396 | * Fires at the start of the signups admin load. |
| | 1397 | * |
| | 1398 | * @since BuddyPress (2.0.0) |
| | 1399 | * |
| | 1400 | * @param string $doaction Current bulk action being processed. |
| | 1401 | * @param array $_REQUEST Current $_REQUEST global. |
| | 1402 | */ |
| 1319 | 1403 | do_action( 'bp_signups_admin_load', $doaction, $_REQUEST ); |
| 1320 | 1404 | |
| 1321 | | // Allowed actions |
| | 1405 | /** |
| | 1406 | * Filters the allowed actions for use in the user signups admin page. |
| | 1407 | * |
| | 1408 | * @since BuddyPress (2.0.0) |
| | 1409 | * |
| | 1410 | * @param array $value Array of allowed actions to use. |
| | 1411 | */ |
| 1322 | 1412 | $allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions', array( 'do_delete', 'do_activate', 'do_resend' ) ); |
| 1323 | 1413 | |
| 1324 | 1414 | // Prepare the display of the Community Profile screen |
| … |
… |
class BP_Members_Admin {
|
| 1449 | 1539 | } else { |
| 1450 | 1540 | $this->redirect = $redirect_to; |
| 1451 | 1541 | |
| | 1542 | /** |
| | 1543 | * Fires at the end of the signups admin load if the doaction |
| | 1544 | * does not match any actions. |
| | 1545 | * |
| | 1546 | * @since BuddyPress (2.0.0) |
| | 1547 | * |
| | 1548 | * @param string $doaction Current bulk action being processed. |
| | 1549 | * @param array $_REQUEST Current $_REQUEST global. |
| | 1550 | * @param string $redirect Determined redirect url to send user to. |
| | 1551 | */ |
| 1452 | 1552 | do_action( 'bp_members_admin_update_signups', $doaction, $_REQUEST, $this->redirect ); |
| 1453 | 1553 | |
| 1454 | 1554 | bp_core_redirect( $this->redirect ); |