- Timestamp:
- 08/13/2022 08:21:06 AM (3 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.