Skip to content

Commit

Permalink
plugin active check
Browse files Browse the repository at this point in the history
on the front end is_plugin_active funciton is not working, need to load
the plugin.php file to enable the funciton.
  • Loading branch information
aurovrata committed Feb 23, 2023
1 parent 0811928 commit b8ba201
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/class-reorder-post-within-categories-public.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ private function is_manual_sort_query($wp_query, $print_dbg=false){
*/
static private function is_ranked($taxonomy, $term_id, &$type, $wp_query=null, $print_dbg=false){
if(empty($wp_query) && empty($type)) return false;

/** @since 2.9.0 speedup ranking check */
if(!isset(self::$tax_options)){
self::$tax_options = get_option(RPWC_OPTIONS_2, array());
Expand All @@ -207,8 +206,10 @@ static private function is_ranked($taxonomy, $term_id, &$type, $wp_query=null, $
}
}
}
if(isset(self::$ranked_terms[$term_id])) $type = self::$ranked_terms[$term_id];
else return false; //term id is not manually ranked.
if(!isset(self::$ranked_terms[$term_id])) return false; //term id is not manually ranked.

if(empty($type)) $type = self::$ranked_terms[$term_id]; //try the one cached

switch(true){
case 'any' == $type:
return false; //multi type search cannot be done.
Expand Down Expand Up @@ -452,6 +453,7 @@ static public function get_adjacent_post($post_id, $term_id, $post_type, $taxono
*@return string text_description
*/
public function override_woocommerce_products($override, $wp_query, $taxonomy, $term_id, $type){
include_once ABSPATH . 'wp-admin/includes/plugin.php';
if(!is_plugin_active('woocommerce/woocommerce.php')) return $override; /** @since 2.12.2*/
else{
$ob = $wp_query->query_vars['orderby'];
Expand Down

0 comments on commit b8ba201

Please sign in to comment.