Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 09:32:04 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Breathing room for cast variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-functions.php

    r5686 r5729  
    5555
    5656    if ( $blog_ids ) {
    57         foreach( (array)$blog_ids as $blog_id ) {
     57        foreach( (array) $blog_ids as $blog_id ) {
    5858            $users      = get_users( array( 'blog_id' => $blog_id ) );
    5959            $subscribers    = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) );
    6060
    6161            if ( !empty( $users ) ) {
    62                 foreach ( (array)$users as $user ) {
     62                foreach ( (array) $users as $user ) {
    6363                    // Don't record blogs for subscribers
    6464                    if ( !in_array( $user, $subscribers ) )
     
    100100    bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'last_activity', bp_core_current_time() );
    101101
    102     $is_private = !empty( $_POST['blog_public'] ) && (int)$_POST['blog_public'] ? false : true;
     102    $is_private = !empty( $_POST['blog_public'] ) && (int) $_POST['blog_public'] ? false : true;
    103103    $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private );
    104104
     
    150150    global $bp, $wpdb;
    151151
    152     $post_id = (int)$post_id;
    153     $blog_id = (int)$wpdb->blogid;
     152    $post_id = (int) $post_id;
     153    $blog_id = (int) $wpdb->blogid;
    154154
    155155    if ( !$user_id )
    156         $user_id = (int)$post->post_author;
     156        $user_id = (int) $post->post_author;
    157157
    158158    // Stop infinite loops with WordPress MU Sitewide Tags.
     
    165165    }
    166166
    167     if ( (int)$blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) )
     167    if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) )
    168168        return false;
    169169
     
    181181
    182182            if ( is_multisite() )
    183                 $activity_action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
     183                $activity_action  = sprintf( __( '%1$s wrote a new post, %2$s, on the site %3$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>', '<a href="' . get_blog_option( $blog_id, 'home' ) . '">' . get_blog_option( $blog_id, 'blogname' ) . '</a>' );
    184184            else
    185                 $activity_action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int)$post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
     185                $activity_action  = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '<a href="' . $post_permalink . '">' . $post->post_title . '</a>' );
    186186
    187187            // Make sure there's not an existing entry for this post (prevent bumping)
     
    189189                $existing = bp_activity_get( array(
    190190                    'filter' => array(
    191                         'user_id'      => (int)$post->post_author,
     191                        'user_id'      => (int) $post->post_author,
    192192                        'action'       => 'new_blog_post',
    193193                        'primary_id'   => $blog_id,
     
    204204
    205205            bp_blogs_record_activity( array(
    206                 'user_id'           => (int)$post->post_author,
     206                'user_id'           => (int) $post->post_author,
    207207                'action'            => apply_filters( 'bp_blogs_activity_new_post_action',       $activity_action,  $post, $post_permalink ),
    208208                'content'           => apply_filters( 'bp_blogs_activity_new_post_content',      $activity_content, $post, $post_permalink ),
     
    248248    // Get the user_id from the comment author email.
    249249    $user    = get_user_by( 'email', $recorded_comment->comment_author_email );
    250     $user_id = (int)$user->ID;
     250    $user_id = (int) $user->ID;
    251251
    252252    // If there's no registered user id, don't record activity
     
    345345    global $bp;
    346346
    347     $blog_id = (int)$blog_id;
     347    $blog_id = (int) $blog_id;
    348348    do_action( 'bp_blogs_before_remove_blog', $blog_id );
    349349
     
    384384        return false;
    385385
    386     $post_id = (int)$post_id;
     386    $post_id = (int) $post_id;
    387387
    388388    if ( !$blog_id )
    389         $blog_id = (int)$wpdb->blogid;
     389        $blog_id = (int) $wpdb->blogid;
    390390
    391391    if ( !$user_id )
     
    597597    }
    598598
    599     $metas = array_map('maybe_unserialize', (array)$metas);
     599    $metas = array_map('maybe_unserialize', (array) $metas);
    600600
    601601    if ( 1 == count($metas) )
Note: See TracChangeset for help on using the changeset viewer.