Changeset 5734
- Timestamp:
- 05/12/2015 10:44:46 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/functions.php
r5732 r5734 2002 2002 2003 2003 $cache_id = 'bbp_get_forum_' . $forum_id . '_reply_id'; 2004 $reply_id = (int)wp_cache_get( $cache_id, 'bbpress_posts' );2004 $reply_id = wp_cache_get( $cache_id, 'bbpress_posts' ); 2005 2005 2006 2006 if ( false === $reply_id ) { … … 2013 2013 $topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) ); 2014 2014 $reply_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_parent IN ( {$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() ) ); 2015 wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); // May be (int) 02016 2015 } else { 2017 wp_cache_set( $cache_id, '0', 'bbpress_posts' ); 2018 } 2019 } 2020 2021 return (int) apply_filters( 'bbp_get_forum_last_reply_id', (int) $reply_id, $forum_id ); 2016 $reply_id = 0; 2017 } 2018 2019 wp_cache_set( $cache_id, $reply_id, 'bbpress_posts' ); 2020 } else { 2021 $reply_id = (int) $reply_id; 2022 } 2023 2024 return (int) apply_filters( 'bbp_get_forum_last_reply_id', $reply_id, $forum_id ); 2022 2025 } 2023 2026
Note: See TracChangeset
for help on using the changeset viewer.