Ticket #31292: link-template.php.patch
File link-template.php.patch, 3.1 KB (added by , 10 years ago) |
---|
-
link-template.php
1568 1568 * @param array $excluded_terms Array of excluded term IDs. 1569 1569 */ 1570 1570 $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms ); 1571 1572 /** 1573 * Filter the JOIN clause in the SQL for an adjacent post type query. 1574 * 1575 * The dynamic portion of the hook name, `$adjacent`, refers to the type 1576 * of adjacency, 'next' or 'previous'. The dynamic portion`$post->post_type` refers to the current post type 1577 * 1578 * @since 4.2.0 1579 * 1580 * @param string $join The JOIN clause in the SQL. 1581 * @param bool $in_same_term Whether post should be in a same taxonomy term. 1582 * @param array $excluded_terms Array of excluded term IDs. 1583 */ 1584 $join = apply_filters( "get_{$adjacent}_{$post->post_type}_join", $join, $in_same_term, $excluded_terms ); 1571 1585 1572 1586 /** 1573 1587 * Filter the WHERE clause in the SQL for an adjacent post query. 1574 1588 * 1575 1589 * The dynamic portion of the hook name, `$adjacent`, refers to the type 1576 * of adjacency, 'next' or 'previous'. 1590 * of adjacency, 'next' or 'previous'. 1577 1591 * 1578 1592 * @since 2.5.0 1579 1593 * … … 1582 1596 * @param array $excluded_terms Array of excluded term IDs. 1583 1597 */ 1584 1598 $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms ); 1599 1600 /** 1601 * Filter the WHERE clause in the SQL for an adjacent post type query. 1602 * 1603 * The dynamic portion of the hook name, `$adjacent`, refers to the type 1604 * of adjacency, 'next' or 'previous'. The dynamic portion `$post->post_type` refers to the current post type 1605 * 1606 * @since 4.2.0 1607 * 1608 * @param string $where The `WHERE` clause in the SQL. 1609 * @param bool $in_same_term Whether post should be in a same taxonomy term. 1610 * @param array $excluded_terms Array of excluded term IDs. 1611 */ 1612 $where = apply_filters( "get_{$adjacent}_{$post->post_type}_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms ); 1585 1613 1586 1614 /** 1587 1615 * Filter the ORDER BY clause in the SQL for an adjacent post query. … … 1594 1622 * @param string $order_by The `ORDER BY` clause in the SQL. 1595 1623 */ 1596 1624 $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" ); 1625 1626 /** 1627 * Filter the ORDER BY clause in the SQL for an adjacent post query. 1628 * 1629 * The dynamic portion of the hook name, `$adjacent`, refers to the type 1630 * of adjacency, 'next' or 'previous'. The dynamic portion `$post->post_type` refers to the current post type 1631 * 1632 * @since 4.2.0 1633 * 1634 * @param string $order_by The `ORDER BY` clause in the SQL. 1635 */ 1636 $sort = apply_filters( "get_{$adjacent}_{$post->post_type}_sort", "ORDER BY p.post_date $order LIMIT 1" ); 1597 1637 1598 1638 $query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort"; 1599 1639 $query_key = 'adjacent_post_' . md5( $query );