Skip to:
Content

BuddyPress.org

Changeset 9267


Ignore:
Timestamp:
12/24/2014 02:28:15 AM (10 years ago)
Author:
tw2113
Message:

Add hook documentation in bp-members-admin.php.

Props tw2113.
See #5944.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-admin.php

    r9227 r9267  
    553553        $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
    554554        $css = $this->css_url . "admin{$min}.css";
     555
     556        /**
     557         * Filters the CSS URL to enqueue in the Members admin area.
     558         *
     559         * @since BuddyPress (2.0.0)
     560         *
     561         * @param string $css URL to the CSS admin file to load.
     562         */
    555563        $css = apply_filters( 'bp_members_admin_css', $css );
    556564
     
    562570        }
    563571
    564         // Only load javascript for BuddyPress profile
     572        // Only load JavaScript for BuddyPress profile
    565573        if ( get_current_screen()->id == $this->user_page ) {
    566574            $js = $this->js_url . "admin{$min}.js";
     575
     576            /**
     577             * Filters the JS URL to enqueue in the Members admin area.
     578             *
     579             * @since BuddyPress (2.0.0)
     580             *
     581             * @param string $js URL to the JavaScript admin file to load.
     582             */
    567583            $js = apply_filters( 'bp_members_admin_js', $js );
    568584            wp_enqueue_script( 'bp-members-js', $js, array( 'jquery' ), bp_get_version(), true );
    569585        }
    570586
    571         // Plugins may want to hook here to load some css/js
     587        /**
     588         * Fires after all of the members JavaScript and CSS is enqueued.
     589         *
     590         * @since BuddyPress (2.0.0)
     591         *
     592         * @param string $id        ID of the current screen.
     593         * @param array  $screen_id Array of allowed screens to add scripts and styles to.
     594         */
    572595        do_action( 'bp_members_admin_enqueue_scripts', get_current_screen()->id, $this->screen_id );
    573596    }
     
    660683        }
    661684
    662         // Call an action for plugins to hook in early
     685        /**
     686         * Fires at the start of the signups admin load.
     687         *
     688         * @since BuddyPress (2.0.0)
     689         *
     690         * @param string $doaction Current bulk action being processed.
     691         * @param array  $_REQUEST Current $_REQUEST global.
     692         */
    663693        do_action_ref_array( 'bp_members_admin_load', array( $doaction, $_REQUEST ) );
    664694
    665         // Allowed actions
     695        /**
     696         * Filters the allowed actions for use in the user admin page.
     697         *
     698         * @since BuddyPress (2.0.0)
     699         *
     700         * @param array $value Array of allowed actions to use.
     701         */
    666702        $allowed_actions = apply_filters( 'bp_members_admin_allowed_actions', array( 'update', 'delete_avatar', 'spam', 'ham' ) );
    667703
     
    701737
    702738            /**
    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
     739             * Fires before loading the profile fields if component is active.
     740             *
     741             * Plugins should not use this hook, please use 'bp_members_admin_user_metaboxes' instead.
     742             *
     743             * @since BuddyPress (2.0.0)
     744             *
     745             * @param int    $user_id       Current user ID for the screen.
     746             * @param string $id            Current screen ID.
     747             * @param object $stats_metabox Object holding position data for use with the stats metabox.
    705748             */
    706749            do_action_ref_array( 'bp_members_admin_xprofile_metabox', array( $user_id, get_current_screen()->id, $this->stats_metabox ) );
     
    737780
    738781            /**
    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.
     782             * Fires at the end of the Community Profile screen.
     783             *
     784             * Plugins can restrict metabox to "bp_moderate" admins by checking if
     785             * the first argument ($this->is_self_profile) is false in their callback.
     786             * They can also restrict their metabox to self profile editing
     787             * by setting it to true.
     788             *
     789             * @since BuddyPress (2.0.0)
     790             *
     791             * @param bool $is_self_profile Whether or not it is the current user's profile.
     792             * @param int  $user_id         Current user ID.
    744793             */
    745794            do_action( 'bp_members_admin_user_metaboxes', $this->is_self_profile, $user_id );
     
    766815            $this->redirect = $redirect_to;
    767816
     817            /**
     818             * Fires at end of user profile admin load if doaction does not match any available actions.
     819             *
     820             * @since BuddyPress (2.0.0)
     821             *
     822             * @param string $doaction Current bulk action being processed.
     823             * @param int    $user_id  Current user ID.
     824             * @param array  $_REQUEST Current $_REQUEST global.
     825             * @param string $redirect Determined redirect url to send user to.
     826             */
    768827            do_action_ref_array( 'bp_members_admin_update_user', array( $doaction, $user_id, $_REQUEST, $this->redirect ) );
    769828
     
    10061065            // Loading other stats only if user has activated their account
    10071066            if ( empty( $user->user_status ) ) {
     1067
     1068                /**
     1069                 * Fires in the user stats metabox if the user has activated their account.
     1070                 *
     1071                 * @since BuddyPress (2.0.0)
     1072                 *
     1073                 * @param array  $value Array holding the user ID.
     1074                 * @param object $user  Current displayed user object.
     1075                 */
    10081076                do_action( 'bp_members_admin_user_stats', array( 'user_id' => $user->ID ), $user );
    10091077            }
     
    13131381        $doaction    = bp_admin_list_table_current_bulk_action();
    13141382
    1315         // Call an action for plugins to hook in early
     1383        /**
     1384         * Fires at the start of the signups admin load.
     1385         *
     1386         * @since BuddyPress (2.0.0)
     1387         *
     1388         * @param string $doaction Current bulk action being processed.
     1389         * @param array  $_REQUEST Current $_REQUEST global.
     1390         */
    13161391        do_action( 'bp_signups_admin_load', $doaction, $_REQUEST );
    13171392
    1318         // Allowed actions
     1393        /**
     1394         * Filters the allowed actions for use in the user signups admin page.
     1395         *
     1396         * @since BuddyPress (2.0.0)
     1397         *
     1398         * @param array $value Array of allowed actions to use.
     1399         */
    13191400        $allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions', array( 'do_delete', 'do_activate', 'do_resend' ) );
    13201401
     
    14471528                $this->redirect = $redirect_to;
    14481529
     1530                /**
     1531                 * Fires at end of signups admin load if doaction does not match any actions.
     1532                 *
     1533                 * @since BuddyPress (2.0.0)
     1534                 *
     1535                 * @param string $doaction Current bulk action being processed.
     1536                 * @param array  $_REQUEST Current $_REQUEST global.
     1537                 * @param string $redirect Determined redirect url to send user to.
     1538                 */
    14491539                do_action( 'bp_members_admin_update_signups', $doaction, $_REQUEST, $this->redirect );
    14501540
Note: See TracChangeset for help on using the changeset viewer.