- $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_cat, $excluded_categories );
- $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories );
+ /**
+ * Filter the JOIN clause in the SQL for an adjacent post query.
+ *
+ * The dynamic portion of the hook name, $adjacent, refers to the type
+ * of adjacency, 'next' or 'previous'.
+ *
+ * @since 2.5.0
+ *
+ * @param string $join The JOIN clause in the SQL.
+ * @param bool $in_same_term Whether post should be in a same taxonomy term.
+ * @param array $excluded_terms Array of excluded term IDs.
+ */
+ $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms );
+
+ /**
+ * Filter the WHERE clause in the SQL for an adjacent post query.
+ *
+ * The dynamic portion of the hook name, $adjacent, refers to the type
+ * of adjacency, 'next' or 'previous'.
+ *
+ * @since 2.5.0
+ *
+ * @param string $where The WHERE clause in the SQL.
+ * @param bool $in_same_term Whether post should be in a same taxonomy term.
+ * @param array $excluded_terms Array of excluded term IDs.
+ */
+ $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms );
+
+ /**
+ * Filter the ORDER BY clause in the SQL for an adjacent post query.
+ *
+ * The dynamic portion of the hook name, $adjacent, refers to the type
+ * of adjacency, 'next' or 'previous'.
+ *
+ * @since 2.5.0
+ *
+ * @param string $order_by The ORDER BY clause in the SQL.
+ */