Changeset 7773
- Timestamp:
- 02/03/2014 02:43:51 AM (11 years ago)
- Location:
- trunk/bp-activity
- Files:
-
- 2 edited
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 -
trunk/bp-activity/bp-activity-functions.php
r7622 r7773 1253 1253 1254 1254 // Clear the comment cache for this activity 1255 wp_cache_delete( 'bp_activity_comments_' . $parent_id );1255 wp_cache_delete( 'bp_activity_comments_' . $parent_id, 'bp' ); 1256 1256 1257 1257 do_action( 'bp_activity_comment_posted', $comment_id, $params, $activity );
Note: See TracChangeset
for help on using the changeset viewer.