$rule ) { if ( ! empty( $rule['will-be'] ) && ! isset( $rule['if'] ) ) { $xts_woodmart_options[ $option ] = $rule['will-be']; } elseif ( isset( $xts_woodmart_options[ $rule['if'] ] ) && in_array( $xts_woodmart_options[ $rule['if'] ], $rule['in_array'] ) ) { $xts_woodmart_options[ $option ] = $rule['will-be']; } } } /** * Specific options for taxonomies */ public function specific_taxonomy_options( $slug = '' ) { global $xts_woodmart_options; if ( is_category() ) { $option_key = 'blog_design'; $category = get_query_var( 'cat' ); $current_category = get_category( $category ); // $current_category->term_id; $category_blog_design = get_term_meta( $current_category->term_id, '_woodmart_' . $option_key, true ); if ( ! empty( $category_blog_design ) && $category_blog_design != 'inherit' ) { $xts_woodmart_options[ $option_key ] = $category_blog_design; } } } /** * Get option from array $woodmart_options * * @param String option slug * @return String option value */ public function get_opt( $slug, $default = false ) { global $woodmart_options, $xts_woodmart_options; $opt = $default; if ( isset( $xts_woodmart_options[ $slug ] ) ) { $opt = $xts_woodmart_options[ $slug ]; return $opt; } if ( isset( $woodmart_options[ $slug ] ) ) { $opt = $woodmart_options[ $slug ]; return $opt; } return $opt; } } // **********************************************************************// // ! Function to get option // **********************************************************************// if ( ! function_exists( 'woodmart_get_opt' ) ) { function woodmart_get_opt( $slug = '', $default = false ) { return WOODMART_Registry::getInstance()->options->get_opt( $slug, $default ); } }