Changeset 5739
- Timestamp:
- 05/13/2015 12:35:49 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r5730 r5739 1530 1530 1531 1531 $child_id = (int) $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 ) ); 1532 1532 1533 wp_cache_set( $cache_id, $child_id, 'bbpress_posts' ); 1534 } else { 1535 $child_id = (int) $child_id; 1533 1536 } 1534 1537 … … 1578 1581 1579 1582 $child_count = (int) $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 ) ); 1583 1580 1584 wp_cache_set( $cache_id, $child_count, 'bbpress_posts' ); 1585 } else { 1586 $child_count = (int) $child_count; 1581 1587 } 1582 1588 … … 1626 1632 1627 1633 $child_ids = (array) $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 ) ); 1634 1628 1635 wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' ); 1636 } else { 1637 $child_ids = (array) $child_ids; 1629 1638 } 1630 1639 … … 1690 1699 1691 1700 $child_ids = (array) $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 ) ); 1701 1692 1702 wp_cache_set( $cache_id, $child_ids, 'bbpress_posts' ); 1703 } else { 1704 $child_ids = (array) $child_ids; 1693 1705 } 1694 1706
Note: See TracChangeset
for help on using the changeset viewer.