Skip to:
Content

BuddyPress.org

Changeset 13469


Ignore:
Timestamp:
05/06/2023 09:26:21 AM (13 months ago)
Author:
imath
Message:

Remove global vars declarations when corresponding vars are not used

Props upadalavipul

Closes https://github.com/buddypress/buddypress/pull/96
Fixes #8882

Location:
trunk/src
Files:
8 edited

Legend:

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

    r13468 r13469  
    210210 *
    211211 * @global wpdb $wpdb WordPress database object.
    212  * @global WP_Rewrite $wp_rewrite WordPress object implementing a rewrite component API.
    213212 *
    214213 * @since 1.2.0
    215214 */
    216215function bp_core_activation_notice() {
    217     global $wp_rewrite, $wpdb;
     216    global $wpdb;
    218217
    219218    // Only the super admin gets warnings.
  • trunk/src/bp-core/classes/class-bp-optouts-list-table.php

    r13433 r13469  
    5353     */
    5454    public function prepare_items() {
    55         global $usersearch;
    56 
    5755        $search   = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
    5856        $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
  • trunk/src/bp-groups/classes/class-bp-groups-group.php

    r13414 r13469  
    756756     * @since 2.9.0
    757757     *
    758      * @param string      $slug       Slug to check.
    759      *
    760      * @return int|null|false Group ID if found; null if not; false if missing parameters.
     758     * @param  string         $slug Slug to check.
     759     * @return int|null|false       Group ID if found; null if not; false if missing parameters.
    761760     */
    762761    public static function get_id_by_previous_slug( $slug ) {
    763         global $wpdb;
    764 
    765762        if ( empty( $slug ) ) {
    766763            return false;
  • trunk/src/bp-groups/classes/class-bp-groups-member.php

    r13395 r13469  
    10981098     * @since 1.6.0
    10991099     *
    1100      * @param int $group_id ID of the group.
    1101      * @return array Info about group admins (user_id + date_modified).
     1100     * @param  int  $group_id ID of the group.
     1101     * @return array           Info about group admins (user_id + date_modified).
    11021102     */
    11031103    public static function get_group_administrator_ids( $group_id ) {
    1104         global $wpdb;
    1105 
    11061104        if ( empty( $group_id ) ) {
    11071105            return array();
  • trunk/src/bp-members/classes/class-bp-members-invitations-list-table.php

    r13433 r13469  
    6060     */
    6161    public function prepare_items() {
    62         global $usersearch;
    63 
    6462        $search   = isset( $_REQUEST['s'] ) ? $_REQUEST['s'] : '';
    6563        $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
  • trunk/src/bp-members/classes/class-bp-signup.php

    r13414 r13469  
    616616     * @since 2.0.0
    617617     *
    618      * @param int $user_id ID of the user being checked.
    619      * @return int|bool The status if found, otherwise false.
     618     * @param  int      $user_id ID of the user being checked.
     619     * @return int|bool          The status if found, otherwise false.
    620620     */
    621621    public static function check_user_status( $user_id = 0 ) {
    622         global $wpdb;
    623 
    624622        if ( empty( $user_id ) ) {
    625623            return false;
  • trunk/src/bp-templates/bp-nouveau/includes/groups/classes.php

    r13453 r13469  
    126126
    127127    /**
    128      * @since 3.0.0
     128     * Build the Meta Query to get all members list.
     129     *
     130     * @since 3.0.0
     131     *
     132     * @param BP_User_Query $bp_user_query The User Query object.
    129133     */
    130134    public function build_meta_query( BP_User_Query $bp_user_query ) {
     
    144148
    145149    /**
    146      * @since 3.0.0
     150     * Get the list of group invites.
     151     *
     152     * @since 3.0.0
     153     *
     154     * @param integer $user_id  The User ID.
     155     * @param integer $group_id The Group ID.
     156     * @return array            Matching BP_Invitation objects.
    147157     */
    148158    public static function get_inviter_ids( $user_id = 0, $group_id = 0 ) {
    149         global $wpdb;
    150 
    151159        if ( empty( $group_id ) || empty( $user_id ) ) {
    152160            return array();
    153161        }
    154162
    155         return groups_get_invites( array(
    156             'user_id'     => $user_id,
    157             'item_id'     => $group_id,
    158             'invite_sent' => 'sent',
    159             'fields'      => 'inviter_ids'
    160         ) );
     163        return groups_get_invites(
     164            array(
     165                'user_id'     => $user_id,
     166                'item_id'     => $group_id,
     167                'invite_sent' => 'sent',
     168                'fields'      => 'inviter_ids',
     169            )
     170        );
    161171    }
    162172}
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php

    r13414 r13469  
    267267     */
    268268    public static function get_instance( $field_id, $user_id = null, $get_data = true ) {
    269         global $wpdb;
    270 
    271269        $field_id = (int) $field_id;
    272270        if ( ! $field_id ) {
Note: See TracChangeset for help on using the changeset viewer.