| | |
| | | use Exception; |
| | | use JVBase\managers\queue\Queue; |
| | | use JVBase\rest\Rest; |
| | | use JVBase\rest\routes\ApprovalRoutes; |
| | | use JVBase\rest\routes\VoteRoutes; |
| | | use WP_Error; |
| | | use WP_Post; |
| | | use WP_Term; |
| | | use WP_User; |
| | | use WP_Query; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; // Exit if accessed directly |
| | |
| | | }; |
| | | } |
| | | |
| | | public function maybeJoinKarmaOrderby(string $join, \WP_Query $query): string |
| | | public function maybeJoinKarmaOrderby(string $join, WP_Query $query): string |
| | | { |
| | | if (!in_array($query->get('orderby'), ['upvotes', 'downvotes', 'karmic_score'])) { |
| | | return $join; |
| | |
| | | return $join; |
| | | } |
| | | |
| | | public function maybeApplyKarmaOrderby(string $orderby, \WP_Query $query): string |
| | | public function maybeApplyKarmaOrderby(string $orderby, WP_Query $query): string |
| | | { |
| | | $expr = $this->karmaOrderExpr($query->get('orderby')); |
| | | if (!$expr) { |