BBP_User_Engagements_Term::get_query( array $args = array(), $context_key = '', string $meta_key = '', string $meta_type = 'post' )
Get the part of the query responsible for JOINing objects to relationships.
Description Description
Parameters Parameters
- $args
-
(Optional)
Default value: array()
- $meta_key
-
(Optional)
Default value: ''
- $meta_type
-
(Optional)
Default value: 'post'
Return Return
(array)
Source Source
File: includes/common/engagements.php
public function get_query( $args = array(), $context_key = '', $meta_key = '', $meta_type = 'post' ) { $tax_key = "{$meta_key}_{$meta_type}"; $user_key = "{$meta_key}_user_id_"; // Make sure the taxonomy is registered $this->jit_taxonomy( $tax_key ); // Backwards compat for pre-2.6.0 if ( is_numeric( $args ) ) { $args = array( 'tax_query' => array( array( 'taxonomy' => $tax_key, 'terms' => $user_key . bbp_get_user_id( $args, false, false ), 'field' => 'slug' ) ) ); } // Default arguments $defaults = array( 'tax_query' => array( array( 'taxonomy' => $tax_key, 'terms' => $user_key . bbp_get_displayed_user_id(), 'field' => 'slug' ) ) ); // Parse arguments return bbp_parse_args( $args, $defaults, $context_key ); }
Changelog Changelog
Version | Description |
---|---|
2.6.0 | Introduced. |