Changeset 7379 for trunk/src/includes/common/functions.php
- Timestamp:
- 11/24/2025 07:23:06 PM (6 months ago)
- File:
-
- 1 edited
-
trunk/src/includes/common/functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r7378 r7379 1717 1717 * @global WP $wp 1718 1718 * @param string $where 1719 * @param WP_Query $ object1719 * @param WP_Query $query 1720 1720 * @return string 1721 1721 */ 1722 function bbp_query_post_parent__in( $where, $ object= '' ) {1722 function bbp_query_post_parent__in( $where, $query = '' ) { 1723 1723 global $wp; 1724 1724 … … 1729 1729 1730 1730 // Bail if no object passed 1731 if ( empty( $ object) ) {1731 if ( empty( $query ) ) { 1732 1732 return $where; 1733 1733 } 1734 1734 1735 1735 // Only 1 post_parent so return $where 1736 if ( is_numeric( $ object->query_vars['post_parent'] ) ) {1736 if ( is_numeric( $query->query_vars['post_parent'] ) ) { 1737 1737 return $where; 1738 1738 } … … 1742 1742 1743 1743 // Including specific post_parent's 1744 if ( ! empty( $ object->query_vars['post_parent__in'] ) ) {1745 $ids = implode( ',', wp_parse_id_list( $ object->query_vars['post_parent__in'] ) );1744 if ( ! empty( $query->query_vars['post_parent__in'] ) ) { 1745 $ids = implode( ',', wp_parse_id_list( $query->query_vars['post_parent__in'] ) ); 1746 1746 $where .= " AND {$bbp_db->posts}.post_parent IN ($ids)"; 1747 1747 1748 1748 // Excluding specific post_parent's 1749 } elseif ( ! empty( $ object->query_vars['post_parent__not_in'] ) ) {1750 $ids = implode( ',', wp_parse_id_list( $ object->query_vars['post_parent__not_in'] ) );1749 } elseif ( ! empty( $query->query_vars['post_parent__not_in'] ) ) { 1750 $ids = implode( ',', wp_parse_id_list( $query->query_vars['post_parent__not_in'] ) ); 1751 1751 $where .= " AND {$bbp_db->posts}.post_parent NOT IN ($ids)"; 1752 1752 }
Note: See TracChangeset
for help on using the changeset viewer.