AnsPress_Category::terms_clauses( array $pieces, array $taxonomies, array $args )
Description #
Modify term clauses.
Parameters #
- $piecesarray (Required) MySql query parts.
- $taxonomiesarray (Required) Taxonomies.
- $argsarray (Required) Args.
Source #
File: addons/free/category.php
public static function terms_clauses( $pieces, $taxonomies, $args ) { if ( ! in_array( 'question_category', $taxonomies, true ) || ! isset( $args['ap_query'] ) || 'subscription' !== $args['ap_query'] ) { return $pieces; } global $wpdb; $pieces['join'] = $pieces['join'] . ' INNER JOIN ' . $wpdb->prefix . 'ap_meta apmeta ON t.term_id = apmeta.apmeta_actionid'; $pieces['where'] = $pieces['where'] . " AND apmeta.apmeta_type='subscriber' AND apmeta.apmeta_param='category' AND apmeta.apmeta_userid='" . $args['user_id'] . "'"; return $pieces; }
Expand full source code Collapse full source code View on GitHub: addons/free/category.php:487
Add your comment