This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'posts_clauses', 'filter_clauses', 10, 2 ); | |
/** | |
* Filtering everything. | |
* | |
* @param array $clauses Array with all parts of the query. | |
* @param WP_Query $wp_query Object. | |
* @return string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// With dual parameters | |
function modify_query_one( $clauses, $query ) { | |
global $wpdb; | |
if ( isset( $query->query['orderby'] ) && 'color' == $query->query['orderby'] ) { | |
$clauses['join'] .= <<<SQL | |
LEFT OUTER JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id | |
LEFT OUTER JOIN {$wpdb->term_taxonomy} USING (term_taxonomy_id) | |
LEFT OUTER JOIN {$wpdb->terms} USING (term_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript | |
ES6ValidationInspection | |
JSAccessibilityCheckInspection | |
JSBitwiseOperatorUsageInspection | |
JSCheckFunctionSignaturesInspection | |
JSClosureCompilerSyntaxInspection | |
JSCommentMatchesSignatureInspection | |
JSComparisonWithNaNInspection | |
JSConsecutiveCommasInArrayLiteralInspection |