Changeset 4848
- Timestamp:
- 04/15/2013 01:09:37 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbpress.php
r4842 r4848 267 267 $this->errors = new WP_Error(); // Feedback 268 268 $this->tab_index = apply_filters( 'bbp_default_tab_index', 100 ); 269 270 /** Cache *************************************************************/271 272 // Add bbPress to global cache groups273 wp_cache_add_global_groups( 'bbpress' );274 269 } 275 270 -
trunk/includes/common/functions.php
r4847 r4848 1256 1256 1257 1257 // Check for cache and set if needed 1258 $child_id = wp_cache_get( $cache_id, 'bbpress ' );1258 $child_id = wp_cache_get( $cache_id, 'bbpress_posts' ); 1259 1259 if ( empty( $child_id ) ) { 1260 1260 $child_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", $parent_id, $post_type ) ); 1261 wp_cache_set( $cache_id, $child_id, 'bbpress ' );1261 wp_cache_set( $cache_id, $child_id, 'bbpress_posts' ); 1262 1262 } 1263 1263 … … 1299 1299 1300 1300 // Check for cache and set if needed 1301 $child_count = wp_cache_get( $cache_id, 'bbpress ' );1301 $child_count = wp_cache_get( $cache_id, 'bbpress_posts' ); 1302 1302 if ( empty( $child_count ) ) { 1303 1303 $child_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s';", $parent_id, $post_type ) ); 1304 wp_cache_set( $cache_id, $child_count, 'bbpress ' );1304 wp_cache_set( $cache_id, $child_count, 'bbpress_posts' ); 1305 1305 } 1306 1306 … … 1342 1342 1343 1343 // Check for cache and set if needed 1344 $child_ids = wp_cache_get( $cache_id, 'bbpress ' );1344 $child_ids = wp_cache_get( $cache_id, 'bbpress_posts' ); 1345 1345 if ( empty( $child_ids ) ) { 1346 1346 $child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) ); 1347 wp_cache_set( $cache_id, $child_ids, 'bbpress ' );1347 wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' ); 1348 1348 } 1349 1349 … … 1403 1403 1404 1404 // Check for cache and set if needed 1405 $child_ids = wp_cache_get( $cache_id, 'bbpress ' );1405 $child_ids = wp_cache_get( $cache_id, 'bbpress_posts' ); 1406 1406 if ( empty( $child_ids ) ) { 1407 1407 $child_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent = %d AND post_status IN ( {$post_status} ) AND post_type = '%s' ORDER BY ID DESC;", $parent_id, $post_type ) ); 1408 wp_cache_set( $cache_id, $child_ids, 'bbpress ' );1408 wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' ); 1409 1409 } 1410 1410 -
trunk/includes/forums/functions.php
r4819 r4848 1795 1795 1796 1796 $cache_id = 'bbp_get_forum_' . $forum_id . '_reply_id'; 1797 $reply_id = (int) wp_cache_get( $cache_id, 'bbpress ' );1797 $reply_id = (int) wp_cache_get( $cache_id, 'bbpress_posts' ); 1798 1798 1799 1799 if ( empty( $reply_id ) ) { … … 1805 1805 if ( !empty( $topic_ids ) ) { 1806 1806 $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( " . join( ',', $topic_ids ) . " ) AND post_status = '%s' AND post_type = '%s' ORDER BY ID DESC LIMIT 1;", bbp_get_public_status_id(), bbp_get_reply_post_type() ) ); 1807 wp_cache_set( $cache_id, $reply_id, 'bbpress ' ); // May be (int) 01807 wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 0 1808 1808 } else { 1809 wp_cache_set( $cache_id, '0', 'bbpress ' );1809 wp_cache_set( $cache_id, '0', 'bbpress_posts' ); 1810 1810 } 1811 1811 } -
trunk/includes/users/functions.php
r4783 r4848 532 532 533 533 $key = $wpdb->prefix . '_bbp_subscriptions'; 534 $users = wp_cache_get( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress ' );534 $users = wp_cache_get( 'bbp_get_topic_subscribers_' . $topic_id, 'bbpress_users' ); 535 535 if ( empty( $users ) ) { 536 536 $users = $wpdb->get_col( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = '{$key}' and FIND_IN_SET('{$topic_id}', meta_value) > 0" ); 537 wp_cache_set( 'bbp_get_topic_subscribers_' . $topic_id, $users, 'bbpress ' );537 wp_cache_set( 'bbp_get_topic_subscribers_' . $topic_id, $users, 'bbpress_users' ); 538 538 } 539 539
Note: See TracChangeset
for help on using the changeset viewer.