Changeset 13312
- Timestamp:
- 08/13/2022 08:21:06 AM (2 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/classes/class-bp-activity-activity.php
r13184 r13312 1241 1241 ); 1242 1242 1243 $where_args = false;1243 $where_args = array(); 1244 1244 1245 1245 if ( ! empty( $r['user_id'] ) ) { … … 1568 1568 } 1569 1569 1570 $comments = wp_cache_get( $activity_id, 'bp_activity_comments' ); 1570 $comments = array(); 1571 $comments_cache = wp_cache_get( $activity_id, 'bp_activity_comments' ); 1571 1572 1572 1573 // We store the string 'none' to cache the fact that the 1573 1574 // activity item has no comments. 1574 if ( 'none' === $comments ) {1575 $comments =false;1575 if ( 'none' === $comments_cache ) { 1576 return false; 1576 1577 1577 1578 // A true cache miss. 1578 } elseif ( empty( $comments ) ) {1579 } elseif ( empty( $comments_cache ) ) { 1579 1580 1580 1581 $bp = buddypress(); … … 1690 1691 } 1691 1692 1692 // If we cache a value of false, it'll count as a cache1693 // If we cache an empty array, it'll count as a cache 1693 1694 // miss the next time the activity comments are fetched. 1694 1695 // Storing the string 'none' is a hack workaround to 1695 1696 // avoid unnecessary queries. 1696 if ( false ===$comments ) {1697 if ( ! $comments ) { 1697 1698 $cache_value = 'none'; 1698 1699 } else { … … 1701 1702 1702 1703 wp_cache_set( $activity_id, $cache_value, 'bp_activity_comments' ); 1704 } else { 1705 $comments = (array) $comments_cache; 1703 1706 } 1704 1707 -
trunk/src/bp-core/bp-core-avatars.php
r13311 r13312 811 811 812 812 /** This filter is documented in bp-core/bp-core-avatars.php */ 813 $item_id = apply_filters( 'bp_core_avatar_item_id', $args['item_id'], $args['object'] );813 $item_id = (int) apply_filters( 'bp_core_avatar_item_id', $args['item_id'], $args['object'] ); 814 814 } else { 815 $item_id = $args['item_id']; 816 } 817 818 if ( $item_id && ( ctype_digit( $item_id ) || is_int( $item_id ) ) ) { 819 $item_id = (int) $item_id; 820 } else { 815 $item_id = (int) str_replace( '.', '', $args['item_id'] ); 816 } 817 818 if ( ! $item_id ) { 821 819 return false; 822 820 } -
trunk/src/bp-core/bp-core-functions.php
r13304 r13312 3401 3401 } 3402 3402 3403 $db_types = wp_cache_get( $taxonomy, 'bp_object_terms' );3403 $db_types = (array) wp_cache_get( $taxonomy, 'bp_object_terms' ); 3404 3404 3405 3405 if ( ! $db_types ) { -
trunk/src/bp-groups/bp-groups-activity.php
r13108 r13312 890 890 891 891 // Check the time period, and maybe delete their recent group activity. 892 if ( time() <= strtotime( '+5 minutes', (int) strtotime( $membership->date_modified ) ) ) {892 if ( $membership->date_modified && time() <= strtotime( '+5 minutes', (int) strtotime( $membership->date_modified ) ) ) { 893 893 bp_activity_delete( array( 894 894 'component' => buddypress()->groups->id, -
trunk/src/bp-groups/bp-groups-functions.php
r13309 r13312 2970 2970 } 2971 2971 2972 $types = wp_filter_object_list( $types, $args, $operator);2972 $types = array_filter( wp_filter_object_list( $types, $args, $operator ) ); 2973 2973 2974 2974 /** … … 2984 2984 * @param string $operator 'or' to match any of $args, 'and' to require all. 2985 2985 */ 2986 $types = apply_filters( 'bp_groups_get_group_types', $types, $args, $operator );2987 2988 if ( 'names' === $output ) {2986 $types = (array) apply_filters( 'bp_groups_get_group_types', $types, $args, $operator ); 2987 2988 if ( $types && 'names' === $output ) { 2989 2989 $types = wp_list_pluck( $types, 'name' ); 2990 2990 } -
trunk/src/bp-members/bp-members-functions.php
r13309 r13312 3010 3010 } 3011 3011 3012 $types = wp_filter_object_list( $types, $args, $operator);3012 $types = array_filter( wp_filter_object_list( $types, $args, $operator ) ); 3013 3013 3014 3014 /** … … 3024 3024 * @param string $operator 'or' to match any of $args, 'and' to require all. 3025 3025 */ 3026 $types = apply_filters( 'bp_get_member_types', $types, $args, $operator );3027 3028 if ( 'names' === $output ) {3026 $types = (array) apply_filters( 'bp_get_member_types', $types, $args, $operator ); 3027 3028 if ( $types && 'names' === $output ) { 3029 3029 $types = wp_list_pluck( $types, 'name' ); 3030 3030 } -
trunk/src/bp-messages/classes/class-bp-messages-message.php
r13096 r13312 61 61 * Message recipients. 62 62 * 63 * @var bool|array64 */ 65 public $recipients = false;63 * @var array 64 */ 65 public $recipients = array(); 66 66 67 67 /** -
trunk/src/bp-templates/bp-nouveau/includes/functions.php
r13170 r13312 245 245 * from the component ID. 246 246 */ 247 $current_component_id = bp_core_get_active_components( array( ' slug' => bp_current_component() ) );247 $current_component_id = bp_core_get_active_components( array( 'id' => bp_current_component() ) ); 248 248 if ( $current_component_id && 1 === count( $current_component_id ) ) { 249 249 $current_component_id = reset( $current_component_id );
Note: See TracChangeset
for help on using the changeset viewer.