Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/07/2023 12:18:55 AM (4 years ago)
Author:
espellcaste
Message:

PHPDoc: adding improvements to the @global tag definition.

The @global tag is used to inform PHPDoc of a global variable or its usage. The tag was updated where necessary and invalid examples were removed.

Closes ​https://github.com/buddypress/buddypress/pull/53
Fixes #8786

File:
1 edited

Legend:

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

    r13367 r13395  
    272272 * @since 1.9.0
    273273 *
     274 * @global wpdb $wpdb WordPress database object.
     275 *
    274276 * @param string $mentionname Username of user in @-mentions.
    275277 * @return int|bool ID of the user, if one is found. Otherwise false.
    276278 */
    277279function bp_activity_get_userid_from_mentionname( $mentionname ) {
     280        global $wpdb;
     281
    278282        $user_id = false;
    279283
    … …  
    293297                // account for hyphens + spaces in the same user_login.
    294298                if ( empty( $userdata ) || ! is_a( $userdata, 'WP_User' ) ) {
    295                         global $wpdb;
    296299                        $regex   = esc_sql( str_replace( '-', '[ \-]', $mentionname ) );
    297300                        $user_id = $wpdb->get_var( "SELECT ID FROM {$wpdb->users} WHERE user_login REGEXP '{$regex}'" );
    … …  
    305308                $user_id = bp_core_get_userid_from_nicename( $mentionname );
    306309        }
    307 
    308310
    309311        return $user_id;
    … …  
    12401242 * @since 1.2.0
    12411243 *
    1242  * @global object $wpdb WordPress database access object.
    1243  *
    12441244 * @param int    $activity_id ID of the activity item whose metadata is being deleted.
    12451245 * @param string $meta_key    Optional. The key of the metadata being deleted. If
    … …  
    14101410 * @since 1.6.0
    14111411 *
    1412  * @global object $wpdb WordPress database access object.
     1412 * @global wpdb $wpdb WordPress database object.
    14131413 *
    14141414 * @param int $user_id ID of the user whose activity is being spammed.
    … …  
    14791479 * @since 1.6.0
    14801480 *
    1481  * @global object $wpdb WordPress database access object.
     1481 * @global wpdb $wpdb WordPress database object.
    14821482 *
    14831483 * @param int $user_id ID of the user whose activity is being hammed.
Note: See TracChangeset for help on using the changeset viewer.