Skip to:
Content

BuddyPress.org

Changeset 9318


Ignore:
Timestamp:
01/08/2015 10:28:43 PM (10 years ago)
Author:
djpaul
Message:

Remove some of our unused/dead variable assignments.

Identified by scrutinizer-ci.com; https://scrutinizer-ci.com/g/buddypress/BuddyPress/

Location:
trunk/src
Files:
14 edited

Legend:

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

    r9308 r9318  
    497497            akismet_init();
    498498
    499         $query_string = $path = $response = '';
     499        $query_string = $path = '';
    500500
    501501        $activity_data['blog']         = bp_get_option( 'home' );
  • trunk/src/bp-activity/bp-activity-filters.php

    r9308 r9318  
    529529 */
    530530function bp_activity_heartbeat_last_recorded( $response = array(), $data = array() ) {
    531     $bp = buddypress();
    532 
    533531    if ( empty( $data['bp_activity_last_recorded'] ) ) {
    534532        return $response;
  • trunk/src/bp-core/bp-core-admin.php

    r9014 r9318  
    487487     */
    488488    public function about_screen() {
    489         global $wp_rewrite;
    490 
    491         $is_new_install            = ! empty( $_GET['is_new_install'] );
    492         $pretty_permalinks_enabled = ! empty( $wp_rewrite->permalink_structure );
    493         list( $display_version )   = explode( '-', bp_get_version() ); ?>
     489        $is_new_install          = ! empty( $_GET['is_new_install'] );
     490        list( $display_version ) = explode( '-', bp_get_version() ); ?>
    494491
    495492        <div class="wrap about-wrap">
  • trunk/src/bp-core/bp-core-classes.php

    r9315 r9318  
    601601     * @since BuddyPress (1.7.0)
    602602     *
    603      * @global BuddyPress $bp Global BuddyPress settings object.
    604603     * @global WPDB $wpdb Global WordPress database access object.
    605604     */
     
    625624        // Turn user ID's into a query-usable, comma separated value
    626625        $user_ids_sql = implode( ',', wp_parse_id_list( $this->user_ids ) );
    627 
    628         $bp = buddypress();
    629626
    630627        /**
     
    23302327            return $output;
    23312328
    2332         $id_field     = $this->db_fields['id'];
    23332329        $parent_field = $this->db_fields['parent'];
    23342330
  • trunk/src/bp-core/bp-core-filters.php

    r9315 r9318  
    560560    // We use information stored in the CSS class to determine what kind of
    561561    // menu item this is, and how it should be treated
    562     $css_target = preg_match( '/\sbp-(.*)-nav/', implode( ' ', $menu_item->classes), $matches );
     562    preg_match( '/\sbp-(.*)-nav/', implode( ' ', $menu_item->classes), $matches );
    563563
    564564    // If this isn't a BP menu item, we can stop here
  • trunk/src/bp-core/bp-core-functions.php

    r9315 r9318  
    19131913
    19141914    foreach ( $bp_menu_items as $bp_item ) {
    1915         $item_name = '';
    19161915
    19171916        // Remove <span>number</span>
  • trunk/src/bp-core/bp-core-template-loader.php

    r9306 r9318  
    443443 */
    444444function bp_get_theme_compat_templates() {
    445     $page_id       = 0;
    446     $page_template = array();
     445    $page_id = 0;
    447446
    448447    // Get the WordPress Page ID for the current view.
  • trunk/src/bp-friends/bp-friends-activity.php

    r9308 r9318  
    283283 */
    284284function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) {
    285 
    286     // Bail if Activity component is not active
    287285    if ( ! bp_is_active( 'activity' ) ) {
    288286        return;
    289287    }
    290 
    291     // Get links to both members profiles
    292     $initiator_link = bp_core_get_userlink( $initiator_user_id );
    293     $friend_link    = bp_core_get_userlink( $friend_user_id    );
    294288
    295289    // Record in activity streams for the initiator
  • trunk/src/bp-members/bp-members-admin.php

    r9315 r9318  
    218218     */
    219219    private function get_user_id() {
    220 
    221         // No user ID to start
    222         $user_id = 0;
     220        $user_id = get_current_user_id();
    223221
    224222        // We'll need a user ID when not on the user admin
    225223        if ( ! empty( $_GET['user_id'] ) ) {
    226224            $user_id = $_GET['user_id'];
    227 
    228         // Assume the current user ID
    229         } else {
    230             $user_id = get_current_user_id();
    231225        }
    232226
  • trunk/src/bp-members/bp-members-functions.php

    r9315 r9318  
    597597 */
    598598function bp_core_get_user_displayname( $user_id_or_username ) {
    599 
    600     $fullname = '';
    601 
    602599    if ( empty( $user_id_or_username ) ) {
    603600        return false;
  • trunk/src/bp-messages/bp-messages-classes.php

    r9315 r9318  
    364364        $r = wp_parse_args( $args, $defaults );
    365365
    366         $user_id_sql = $pag_sql = $type_sql = $search_sql = '';
     366        $pag_sql = $type_sql = $search_sql = '';
    367367
    368368        if ( $r['limit'] && $r['page'] ) {
  • trunk/src/bp-messages/bp-messages-notifications.php

    r9308 r9318  
    173173            $amount = 'multiple';
    174174            $text   = sprintf( __( 'You have %d new messages', 'buddypress' ), $total_items );
    175             $amount = 'multiple';
    176175        } else {
    177176            $amount = 'single';
  • trunk/src/bp-notifications/bp-notifications-template.php

    r9260 r9318  
    680680     */
    681681    function bp_get_the_notification_description() {
    682 
    683         // Setup local variables
    684         $description  = '';
    685682        $bp           = buddypress();
    686683        $notification = $bp->notifications->query_loop->notification;
  • trunk/src/bp-xprofile/bp-xprofile-cache.php

    r8022 r9318  
    8181
    8282
    83     $bp = buddypress();
     83    $bp        = buddypress();
     84    $cache     = array();
    8485    $meta_list = $wpdb->get_results( "SELECT object_id, object_type, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE {$where_sql}" );
    8586
    8687    if ( ! empty( $meta_list ) ) {
    87         $object_type_caches = array(
    88             'group' => array(),
    89             'field' => array(),
    90             'data'  => array(),
    91         );
    92 
    9388        foreach ( $meta_list as $meta ) {
    9489            $oid    = $meta->object_id;
Note: See TracChangeset for help on using the changeset viewer.