Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_{$adjacent}_post_excluded_terms

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1844       * Possible hook names include:
1845       *
1846       *  - `get_next_post_excluded_terms`
1847       *  - `get_previous_post_excluded_terms`
1848       *
1849       * @since 4.4.0
1850       *
1851       * @param int[]|string $excluded_terms Array of excluded term IDs. Empty string if none were provided.
1852       */
1853      $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms );
1854
1855      if ( $in_same_term || ! empty( $excluded_terms ) ) {
1856           if ( $in_same_term ) {
1857                $join  .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id";
1858                $where .= $wpdb->prepare( 'AND tt.taxonomy = %s', $taxonomy );
1859
1860                if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
1861                     return '';
1862                }