Use transient name directly

This commit is contained in:
Mike Jolley 2015-11-13 23:06:51 +00:00
parent 9ba5b7ee26
commit 78ec168429
1 changed files with 2 additions and 4 deletions

View File

@ -28,14 +28,12 @@ function wc_get_text_attributes( $raw_attributes ) {
* @return array of objects
*/
function wc_get_attribute_taxonomies() {
$transient_name = 'wc_attribute_taxonomies';
if ( false === ( $attribute_taxonomies = get_transient( $transient_name ) ) ) {
if ( false === ( $attribute_taxonomies = get_transient( 'wc_attribute_taxonomies' ) ) ) {
global $wpdb;
$attribute_taxonomies = $wpdb->get_results( "SELECT * FROM " . $wpdb->prefix . "woocommerce_attribute_taxonomies" );
set_transient( $transient_name, $attribute_taxonomies );
set_transient( 'wc_attribute_taxonomies', $attribute_taxonomies );
}
return (array) array_filter( apply_filters( 'woocommerce_attribute_taxonomies', $attribute_taxonomies ) );