Welcome, visitor! Log in
 

Source View: terms_clauses

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.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

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
1986      /**
1987       * Filter the terms query SQL clauses.
1988       *
1989       * @since 3.1.0
1990       *
1991       * @param array $pieces     Terms query SQL clauses.
1992       * @param array $taxonomies An array of taxonomies.
1993       * @param array $args       An array of terms query arguments.
1994       */
1995      $clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
1996
1997      $fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
1998      $join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
1999      $where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
2000      $orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
2001      $order = isset( $clauses[ 'order' ] ) ? $clauses[ 'order' ] : '';
2002      $limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
2003
2004      $query = "SELECT $fields FROM $wpdb->terms AS t $join WHERE $where $orderby $order $limits";