get_row( $wpdb->prepare( "SELECT * FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies WHERE attribute_name = %s", $attr ) ); //phpcs:ignore $swatch_type = isset($attr->attribute_type) ? $attr->attribute_type : ''; if(is_admin()){ return $swatch_type; } } // product override if( $product_id ){ $product_meta = get_post_meta( $product_id, '_swatchly_product_meta', true ); $auto_convert_dropdowns_to_label = isset($product_meta['auto_convert_dropdowns_to_label']) ? $product_meta['auto_convert_dropdowns_to_label'] : ''; $swatch_type = isset( $product_meta[$taxonomy]['swatch_type'] ) && $product_meta[$taxonomy]['swatch_type'] ? $product_meta[$taxonomy]['swatch_type'] : $swatch_type; } return $swatch_type; } /** * Get the directory name of the current theme regardless of the child theme. * * @return The directory name of the theme's "stylesheet" files, inside the theme root. */ function swatchly_get_current_theme_directory(){ $current_theme_dir = ''; $current_theme = wp_get_theme(); if( $current_theme->exists() && $current_theme->parent() ){ $parent_theme = $current_theme->parent(); if( $parent_theme->exists() ){ $current_theme_dir = $parent_theme->get_stylesheet(); } } elseif( $current_theme->exists() ) { $current_theme_dir = $current_theme->get_stylesheet(); } return $current_theme_dir; }