Changeset 6607 for trunk/src/includes/common/functions.php
- Timestamp:
- 07/02/2017 04:39:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r6586 r6607 1472 1472 1473 1473 $query = new WP_Query( array( 1474 'fields' => 'ids', 1475 'post_parent' => $parent_id, 1476 'post_status' => $post_status, 1477 'post_type' => $post_type, 1478 'orderby' => array( 1474 'fields' => 'ids', 1475 'post_parent' => $parent_id, 1476 'post_status' => $post_status, 1477 'post_type' => $post_type, 1478 'posts_per_page' => 1, 1479 'orderby' => array( 1479 1480 'post_date' => 'DESC', 1480 1481 'ID' => 'DESC' 1481 1482 ), 1482 1483 1483 // Maybe change these later1484 ' posts_per_page' => 1,1484 // Performance 1485 'suppress_filters' => true, 1485 1486 'update_post_term_cache' => false, 1486 1487 'update_post_meta_cache' => false, … … 1508 1509 1509 1510 // Bail if nothing passed 1510 if ( empty( $parent_id ) ) {1511 if ( empty( $parent_id ) || empty( $post_type ) ) { 1511 1512 return false; 1512 1513 } … … 1521 1522 1522 1523 $query = new WP_Query( array( 1523 'fields' => 'ids', 1524 'post_parent' => $parent_id, 1525 'post_status' => $post_status, 1526 'post_type' => $post_type, 1527 1528 // Maybe change these later 1529 'posts_per_page' => -1, 1524 'fields' => 'ids', 1525 'post_parent' => $parent_id, 1526 'post_status' => $post_status, 1527 'post_type' => $post_type, 1528 'posts_per_page' => -1, 1529 1530 // Performance 1531 'nopaging' => true, 1532 'suppress_filters' => true, 1530 1533 'update_post_term_cache' => false, 1531 1534 'update_post_meta_cache' => false, … … 1567 1570 1568 1571 $query = new WP_Query( array( 1569 'fields' => 'ids', 1570 'suppress_filters' => true, 1571 'post_parent' => $parent_id, 1572 'post_status' => $post_status, 1573 'post_type' => $post_type, 1574 'posts_per_page' => -1, 1575 1576 // Maybe change these later 1572 'fields' => 'ids', 1573 'post_parent' => $parent_id, 1574 'post_status' => $post_status, 1575 'post_type' => $post_type, 1576 'posts_per_page' => -1, 1577 'orderby' => array( 1578 'post_date' => 'DESC', 1579 'ID' => 'DESC' 1580 ), 1581 1582 // Performance 1583 'nopaging' => true, 1584 'suppress_filters' => true, 1577 1585 'update_post_term_cache' => false, 1578 1586 'update_post_meta_cache' => false, 1579 1587 'ignore_sticky_posts' => true, 1580 'no_found_rows' => true, 1581 'nopaging' => true 1588 'no_found_rows' => true 1582 1589 ) ); 1583 1590 $child_ids = ! empty( $query->posts ) ? $query->posts : array();
Note: See TracChangeset
for help on using the changeset viewer.