Skip to:
Content

BuddyPress.org

Changeset 9696


Ignore:
Timestamp:
04/05/2015 04:30:16 AM (5 years ago)
Author:
tw2113
Message:

Adds hooks documentation for class-bp-core-user.php.

See #5940.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-core-user.php

    r9486 r9696  
    377377        }
    378378
    379         // Get paginated results
     379        /**
     380         * Filters the SQL used to query for paged users.
     381         *
     382         * @since BuddyPress (1.2.6)
     383         *
     384         * @param string $value Concatenated SQL statement for the query.
     385         * @param array  $sql   Array of SQL statement parts for the query.
     386         */
    380387        $paged_users_sql = apply_filters( 'bp_core_get_paged_users_sql', join( ' ', (array) $sql ), $sql );
    381388        $paged_users     = $wpdb->get_results( $paged_users_sql );
     
    402409        array_unshift( $sql, "SELECT COUNT(u.ID)" );
    403410
    404         // Get total user results
     411        /**
     412         * Filters the SQL used to query for total users.
     413         *
     414         * @since BuddyPress (1.2.6)
     415         *
     416         * @param string $value Concatenated SQL statement for the query.
     417         * @param array  $sql   Array of SQL statement parts for the query.
     418         */
    405419        $total_users_sql = apply_filters( 'bp_core_get_total_users_sql', join( ' ', (array) $sql ), $sql );
    406420        $total_users     = $wpdb->get_var( $total_users_sql );
     
    471485        }
    472486
     487        /**
     488         * Filters the SQL used to query for total user count by first letter.
     489         *
     490         * @since BuddyPress (1.0.0)
     491         *
     492         * @param string $value SQL prepared statement for the user count query.
     493         */
    473494        $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", bp_xprofile_fullname_field_name(), $letter_like ) );
     495
     496        /**
     497         * Filters the SQL used to query for users by first letter.
     498         *
     499         * @since BuddyPress (1.0.0)
     500         *
     501         * @param string $value SQL prepared statement for the user query.
     502         */
    474503        $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name(), $letter_like ) );
    475504
     
    564593        $status_sql        = bp_core_get_status_sql( 'u.' );
    565594
     595        /**
     596         * Filters the SQL used to query for searched users count.
     597         *
     598         * @since BuddyPress (1.0.0)
     599         *
     600         * @param string $value SQL statement for the searched users count query.
     601         */
    566602        $total_users_sql = apply_filters( 'bp_core_search_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) as id FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC", $search_terms_like ), $search_terms );
     603
     604        /**
     605         * Filters the SQL used to query for searched users.
     606         *
     607         * @since BuddyPress (1.0.0)
     608         *
     609         * @param string $value SQL statement for the searched users query.
     610         */
    567611        $paged_users_sql = apply_filters( 'bp_core_search_users_sql',       $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id WHERE {$status_sql} AND pd.value LIKE %s ORDER BY pd.value ASC{$pag_sql}", $search_terms_like ), $search_terms, $pag_sql );
    568612
     
    739783     * existing entry.
    740784     *
    741      * @since 2.0
     785     * @since BuddyPress (2.0.0)
    742786     *
    743787     * @param int $user_id ID of the user whose last_activity you are updating.
     
    828872     * Delete a user's last_activity value.
    829873     *
    830      * @since 2.0
     874     * @since BuddyPress (2.0.0)
    831875     *
    832876     * @param int $user_id
Note: See TracChangeset for help on using the changeset viewer.