AnsPress_Tag::terms_clauses( array $query, array $taxonomies, array $args )
Description #
Modify terms mysql quries.
Parameters #
- $queryarray (Required) Query parameters.
- $taxonomiesarray (Required) Available taxonomies.
- $argsarray (Required) Arguments.
Source #
File: addons/free/tag.php
public static function terms_clauses( $query, $taxonomies, $args ) { if ( isset( $args['ap_tags_query'] ) && 'num_rows' === $args['ap_tags_query'] ) { $query['fields'] = 'SQL_CALC_FOUND_ROWS ' . $query['fields']; } if ( in_array( 'question_tag', $taxonomies, true ) && isset( $args['ap_query'] ) && 'tags_subscription' === $args['ap_query'] ) { global $wpdb; $query['join'] = $query['join'].' INNER JOIN ' . $wpdb->prefix . 'ap_meta apmeta ON t.term_id = apmeta.apmeta_actionid'; $query['where'] = $query['where'] . " AND apmeta.apmeta_type='subscriber' AND apmeta.apmeta_param='tag' AND apmeta.apmeta_userid='" . $args['user_id'] . "'"; } return $query; }
Expand full source code Collapse full source code View on GitHub: addons/free/tag.php:506
Add your comment