Changeset 7773 for trunk/bp-activity/bp-activity-classes.php
- Timestamp:
- 02/03/2014 02:43:51 AM (12 years ago)
- File:
-
- 1 edited
-
trunk/bp-activity/bp-activity-classes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-classes.php
r7771 r7773 868 868 } 869 869 870 if ( !$comments = wp_cache_get( 'bp_activity_comments_' . $activity_id ) ) { 870 $comments = wp_cache_get( 'bp_activity_comments_' . $activity_id, 'bp' ); 871 872 // We store the string 'none' to cache the fact that the 873 // activity item has no comments 874 if ( 'none' === $comments ) { 875 $comments = false; 876 877 // A true cache miss 878 } else if ( empty( $comments ) ) { 871 879 872 880 // Select the user's fullname with the query … … 912 920 } 913 921 } 914 wp_cache_set( 'bp_activity_comments_' . $activity_id, $comments, 'bp' ); 922 923 // If we cache a value of false, it'll count as a cache 924 // miss the next time the activity comments are fetched. 925 // Storing the string 'none' is a hack workaround to 926 // avoid unnecessary queries. 927 if ( false === $comments ) { 928 $cache_value = 'none'; 929 } else { 930 $cache_value = $comments; 931 } 932 933 wp_cache_set( 'bp_activity_comments_' . $activity_id, $cache_value, 'bp' ); 915 934 } 916 935
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)