• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wc_get_attribute_taxonomies函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wc_get_attribute_taxonomies函数的典型用法代码示例。如果您正苦于以下问题:PHP wc_get_attribute_taxonomies函数的具体用法?PHP wc_get_attribute_taxonomies怎么用?PHP wc_get_attribute_taxonomies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wc_get_attribute_taxonomies函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: attribute_taxonomies

 public static function attribute_taxonomies()
 {
     global $woocommerce;
     if (!isset($woocommerce)) {
         return array();
     }
     $attributes = array();
     if (function_exists('wc_get_attribute_taxonomies')) {
         $attribute_taxonomies = wc_get_attribute_taxonomies();
     } else {
         $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
     }
     if (empty($attribute_taxonomies)) {
         return array();
     }
     foreach ($attribute_taxonomies as $attribute) {
         /* FIX TO WOOCOMMERCE 2.1 */
         if (function_exists('wc_attribute_taxonomy_name')) {
             $taxonomy = wc_attribute_taxonomy_name($attribute->attribute_name);
         } else {
             $taxonomy = $woocommerce->attribute_taxonomy_name($attribute->attribute_name);
         }
         if (taxonomy_exists($taxonomy)) {
             $attributes[] = $attribute->attribute_name;
         }
     }
     return $attributes;
 }
开发者ID:GaryJones,项目名称:goombiel,代码行数:28,代码来源:class.yith-wcan-helper.php


示例2: __construct

 /**
  * Constructor.
  */
 public function __construct()
 {
     // Category/term ordering
     add_action('create_term', array($this, 'create_term'), 5, 3);
     add_action('delete_term', array($this, 'delete_term'), 5);
     // Add form
     add_action('product_cat_add_form_fields', array($this, 'add_category_fields'));
     add_action('product_cat_edit_form_fields', array($this, 'edit_category_fields'), 10);
     add_action('created_term', array($this, 'save_category_fields'), 10, 3);
     add_action('edit_term', array($this, 'save_category_fields'), 10, 3);
     // Add columns
     add_filter('manage_edit-product_cat_columns', array($this, 'product_cat_columns'));
     add_filter('manage_product_cat_custom_column', array($this, 'product_cat_column'), 10, 3);
     // Taxonomy page descriptions
     add_action('product_cat_pre_add_form', array($this, 'product_cat_description'));
     add_action('product_shipping_class_pre_add_form', array($this, 'shipping_class_description'));
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     if ($attribute_taxonomies) {
         foreach (array_keys($attribute_taxonomies) as $attribute) {
             add_action($attribute . '_pre_add_form', array($this, 'product_attribute_description'));
         }
     }
     // Maintain hierarchy of terms
     add_filter('wp_terms_checklist_args', array($this, 'disable_checked_ontop'));
 }
开发者ID:bitoncoin,项目名称:woocommerce,代码行数:28,代码来源:class-wc-admin-taxonomies.php


示例3: LoadRestrictions

 /**
  * Load the restrictions from the database
  */
 private function LoadRestrictions()
 {
     if ($this->restrictions_loaded) {
         return;
     }
     // Attribute/Variation Restrictions
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     $taxonomies = array();
     foreach ($attribute_taxonomies as $taxonomy) {
         $taxonomies[] = wc_attribute_taxonomy_name($taxonomy->attribute_name);
     }
     $restrictions = get_terms(array('taxonomy' => $taxonomies, 'meta_query' => array(array('key' => 'multiple_of', 'compare' => 'EXISTS')), 'hide_empty' => false));
     if (is_array($restrictions)) {
         foreach ($restrictions as $restriction) {
             $this->multiple_ofs_attributes[$restriction->term_id] = $this->GetMultipleOfForAttribute($restriction->term_id);
             if (!$this->multiple_ofs_attributes[$restriction->term_id]) {
                 unset($this->multiple_ofs_attributes[$restriction->term_id]);
             }
         }
     }
     // Category Restrictions
     $restrictions = get_terms(array('taxonomy' => 'product_cat', 'meta_query' => array(array('key' => 'cat_multiple_of', 'compare' => 'EXISTS')), 'hide_empty' => false));
     if (is_array($restrictions)) {
         foreach ($restrictions as $restriction) {
             $this->multiple_ofs_categories[$restriction->term_id] = $this->GetMultipleOfForCategory($restriction->term_id);
             if (!$this->multiple_ofs_categories[$restriction->term_id]) {
                 unset($this->multiple_ofs_categories[$restriction->term_id]);
             }
         }
     }
     $this->cart_must_be_multiple_of = intval(get_option('woocommerce_cart_multiple_of', 0));
     $this->restrictions_loaded = true;
 }
开发者ID:OM4,项目名称:WooCommerce-Product-Restrictions,代码行数:36,代码来源:product-restrictions.php


示例4: automatic_add_features

    /**
     * Automatic Set all Product Attribute as Compare Features
     *
     */
    public function automatic_add_features()
    {
        $current_db_version = get_option('woocommerce_db_version', null);
        if (version_compare($current_db_version, '2.1.0', '<') && null !== $current_db_version) {
            global $woocommerce;
            $top_variations = $woocommerce->get_attribute_taxonomies();
        } else {
            $top_variations = wc_get_attribute_taxonomies();
        }
        if ($top_variations) {
            foreach ($top_variations as $top_variation) {
                $check_existed = WC_Compare_Data::get_count("field_name='" . trim(addslashes($top_variation->attribute_label)) . "'");
                if ($check_existed < 1) {
                    $child_variations = get_terms(version_compare($current_db_version, '2.1.0', '<') && null !== $current_db_version ? $woocommerce->attribute_taxonomy_name($top_variation->attribute_name) : wc_attribute_taxonomy_name($top_variation->attribute_name), array('parent' => 0, 'hide_empty' => 0, 'hierarchical' => 0));
                    $default_value = '';
                    if (count($child_variations) > 0) {
                        $line = '';
                        foreach ($child_variations as $child_variation) {
                            $default_value .= $line . addslashes($child_variation->name);
                            $line = '
';
                        }
                    }
                    if (trim($default_value) != '') {
                        $feature_id = WC_Compare_Data::insert_row(array('field_name' => trim(addslashes($top_variation->attribute_label)), 'field_type' => 'checkbox', 'field_unit' => '', 'default_value' => $default_value));
                    } else {
                        $feature_id = WC_Compare_Data::insert_row(array('field_name' => trim(addslashes($top_variation->attribute_label)), 'field_type' => 'input-text', 'field_unit' => '', 'default_value' => ''));
                    }
                }
            }
        }
    }
开发者ID:shubham79,项目名称:Jhintaak,代码行数:36,代码来源:class-wc-compare-install.php


示例5: woocommerce_layered_nav_init

 /**
  * Layered Nav Init
  *
  * @package    WooCommerce/Widgets
  * @access     public
  * @return void
  */
 public function woocommerce_layered_nav_init()
 {
     if (is_active_widget(false, false, 'yith-woo-ajax-navigation', true) && !is_admin()) {
         global $_chosen_attributes, $woocommerce;
         $_chosen_attributes = array();
         /* FIX TO WOOCOMMERCE 2.1 */
         $attibute_taxonomies = function_exists('wc_get_attribute_taxonomies') ? $attribute_taxonomies = wc_get_attribute_taxonomies() : ($attribute_taxonomies = $woocommerce->get_attribute_taxonomies());
         if ($attribute_taxonomies) {
             foreach ($attribute_taxonomies as $tax) {
                 $attribute = wc_sanitize_taxonomy_name($tax->attribute_name);
                 /* FIX TO WOOCOMMERCE 2.1 */
                 if (function_exists('wc_attribute_taxonomy_name')) {
                     $taxonomy = wc_attribute_taxonomy_name($attribute);
                 } else {
                     $taxonomy = $woocommerce->attribute_taxonomy_name($attribute);
                 }
                 $name = 'filter_' . $attribute;
                 $query_type_name = 'query_type_' . $attribute;
                 if (!empty($_GET[$name]) && taxonomy_exists($taxonomy)) {
                     $_chosen_attributes[$taxonomy]['terms'] = explode(',', $_GET[$name]);
                     if (empty($_GET[$query_type_name]) || !in_array(strtolower($_GET[$query_type_name]), array('and', 'or'))) {
                         $_chosen_attributes[$taxonomy]['query_type'] = apply_filters('woocommerce_layered_nav_default_query_type', 'and');
                     } else {
                         $_chosen_attributes[$taxonomy]['query_type'] = strtolower($_GET[$query_type_name]);
                     }
                 }
             }
         }
         if (version_compare(preg_replace('/-beta-([0-9]+)/', '', $woocommerce->version), '2.1', '<')) {
             add_filter('loop_shop_post_in', 'woocommerce_layered_nav_query');
         } else {
             add_filter('loop_shop_post_in', array(WC()->query, 'layered_nav_query'));
         }
     }
 }
开发者ID:Inteleck,项目名称:hwc,代码行数:42,代码来源:class.yith-wcan-frontend.php


示例6: color_layered_nav_init

 public function color_layered_nav_init()
 {
     if (!is_active_widget(false, false, 'woocommerce_layered_nav', true) && !is_admin()) {
         global $_chosen_attributes;
         $_chosen_attributes = array();
         $attribute_taxonomies = wc_get_attribute_taxonomies();
         if ($attribute_taxonomies) {
             foreach ($attribute_taxonomies as $tax) {
                 if ($tax->attribute_name == "color") {
                     $attribute = wc_sanitize_taxonomy_name($tax->attribute_name);
                     $taxonomy = wc_attribute_taxonomy_name($attribute);
                     $name = 'filter_' . $attribute;
                     $query_type_name = 'query_type_' . $attribute;
                     $taxonomy_exists = in_array($taxonomy, wc_get_attribute_taxonomy_names());
                     if (!empty($_GET[$name]) && $taxonomy_exists) {
                         $_chosen_attributes[$taxonomy]['terms'] = explode(',', $_GET[$name]);
                         if (empty($_GET[$query_type_name]) || !in_array(strtolower($_GET[$query_type_name]), array('and', 'or'))) {
                             $_chosen_attributes[$taxonomy]['query_type'] = apply_filters('woocommerce_layered_nav_default_query_type', 'and');
                         } else {
                             $_chosen_attributes[$taxonomy]['query_type'] = strtolower($_GET[$query_type_name]);
                         }
                     }
                 }
             }
         }
         $wc_query = new WC_Query();
         add_filter('loop_shop_post_in', array($wc_query, 'layered_nav_query'));
     }
 }
开发者ID:mynein,项目名称:myne,代码行数:29,代码来源:wd_product_color.php


示例7: register_taxonomies

 /**
  * Register core taxonomies.
  */
 public static function register_taxonomies()
 {
     if (taxonomy_exists('product_type')) {
         return;
     }
     do_action('woocommerce_register_taxonomy');
     $permalinks = get_option('woocommerce_permalinks');
     register_taxonomy('product_type', apply_filters('woocommerce_taxonomy_objects_product_type', array('product')), apply_filters('woocommerce_taxonomy_args_product_type', array('hierarchical' => false, 'show_ui' => false, 'show_in_nav_menus' => false, 'query_var' => is_admin(), 'rewrite' => false, 'public' => false)));
     register_taxonomy('product_cat', apply_filters('woocommerce_taxonomy_objects_product_cat', array('product')), apply_filters('woocommerce_taxonomy_args_product_cat', array('hierarchical' => true, 'update_count_callback' => '_wc_term_recount', 'label' => __('Product Categories', 'woocommerce'), 'labels' => array('name' => __('Product Categories', 'woocommerce'), 'singular_name' => __('Product Category', 'woocommerce'), 'menu_name' => _x('Categories', 'Admin menu name', 'woocommerce'), 'search_items' => __('Search Product Categories', 'woocommerce'), 'all_items' => __('All Product Categories', 'woocommerce'), 'parent_item' => __('Parent Product Category', 'woocommerce'), 'parent_item_colon' => __('Parent Product Category:', 'woocommerce'), 'edit_item' => __('Edit Product Category', 'woocommerce'), 'update_item' => __('Update Product Category', 'woocommerce'), 'add_new_item' => __('Add New Product Category', 'woocommerce'), 'new_item_name' => __('New Product Category Name', 'woocommerce')), 'show_ui' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', 'assign_terms' => 'assign_product_terms'), 'rewrite' => array('slug' => empty($permalinks['category_base']) ? _x('product-category', 'slug', 'woocommerce') : $permalinks['category_base'], 'with_front' => false, 'hierarchical' => true))));
     register_taxonomy('product_tag', apply_filters('woocommerce_taxonomy_objects_product_tag', array('product')), apply_filters('woocommerce_taxonomy_args_product_tag', array('hierarchical' => false, 'update_count_callback' => '_wc_term_recount', 'label' => __('Product Tags', 'woocommerce'), 'labels' => array('name' => __('Product Tags', 'woocommerce'), 'singular_name' => __('Product Tag', 'woocommerce'), 'menu_name' => _x('Tags', 'Admin menu name', 'woocommerce'), 'search_items' => __('Search Product Tags', 'woocommerce'), 'all_items' => __('All Product Tags', 'woocommerce'), 'edit_item' => __('Edit Product Tag', 'woocommerce'), 'update_item' => __('Update Product Tag', 'woocommerce'), 'add_new_item' => __('Add New Product Tag', 'woocommerce'), 'new_item_name' => __('New Product Tag Name', 'woocommerce'), 'popular_items' => __('Popular Product Tags', 'woocommerce'), 'separate_items_with_commas' => __('Separate Product Tags with commas', 'woocommerce'), 'add_or_remove_items' => __('Add or remove Product Tags', 'woocommerce'), 'choose_from_most_used' => __('Choose from the most used Product tags', 'woocommerce'), 'not_found' => __('No Product Tags found', 'woocommerce')), 'show_ui' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', 'assign_terms' => 'assign_product_terms'), 'rewrite' => array('slug' => empty($permalinks['tag_base']) ? _x('product-tag', 'slug', 'woocommerce') : $permalinks['tag_base'], 'with_front' => false))));
     register_taxonomy('product_shipping_class', apply_filters('woocommerce_taxonomy_objects_product_shipping_class', array('product', 'product_variation')), apply_filters('woocommerce_taxonomy_args_product_shipping_class', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Shipping Classes', 'woocommerce'), 'labels' => array('name' => __('Shipping Classes', 'woocommerce'), 'singular_name' => __('Shipping Class', 'woocommerce'), 'menu_name' => _x('Shipping Classes', 'Admin menu name', 'woocommerce'), 'search_items' => __('Search Shipping Classes', 'woocommerce'), 'all_items' => __('All Shipping Classes', 'woocommerce'), 'parent_item' => __('Parent Shipping Class', 'woocommerce'), 'parent_item_colon' => __('Parent Shipping Class:', 'woocommerce'), 'edit_item' => __('Edit Shipping Class', 'woocommerce'), 'update_item' => __('Update Shipping Class', 'woocommerce'), 'add_new_item' => __('Add New Shipping Class', 'woocommerce'), 'new_item_name' => __('New Shipping Class Name', 'woocommerce')), 'show_ui' => false, 'show_in_nav_menus' => false, 'query_var' => is_admin(), 'capabilities' => array('manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', 'assign_terms' => 'assign_product_terms'), 'rewrite' => false)));
     global $wc_product_attributes;
     $wc_product_attributes = array();
     if ($attribute_taxonomies = wc_get_attribute_taxonomies()) {
         foreach ($attribute_taxonomies as $tax) {
             if ($name = wc_attribute_taxonomy_name($tax->attribute_name)) {
                 $tax->attribute_public = absint(isset($tax->attribute_public) ? $tax->attribute_public : 1);
                 $label = !empty($tax->attribute_label) ? $tax->attribute_label : $tax->attribute_name;
                 $wc_product_attributes[$name] = $tax;
                 $taxonomy_data = array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'labels' => array('name' => $label, 'singular_name' => $label, 'search_items' => sprintf(__('Search %s', 'woocommerce'), $label), 'all_items' => sprintf(__('All %s', 'woocommerce'), $label), 'parent_item' => sprintf(__('Parent %s', 'woocommerce'), $label), 'parent_item_colon' => sprintf(__('Parent %s:', 'woocommerce'), $label), 'edit_item' => sprintf(__('Edit %s', 'woocommerce'), $label), 'update_item' => sprintf(__('Update %s', 'woocommerce'), $label), 'add_new_item' => sprintf(__('Add New %s', 'woocommerce'), $label), 'new_item_name' => sprintf(__('New %s', 'woocommerce'), $label)), 'show_ui' => false, 'query_var' => 1 === $tax->attribute_public, 'rewrite' => false, 'sort' => false, 'public' => 1 === $tax->attribute_public, 'show_in_nav_menus' => 1 === $tax->attribute_public && apply_filters('woocommerce_attribute_show_in_nav_menus', false, $name), 'capabilities' => array('manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', 'assign_terms' => 'assign_product_terms'));
                 if (1 === $tax->attribute_public) {
                     $taxonomy_data['rewrite'] = array('slug' => empty($permalinks['attribute_base']) ? '' : trailingslashit($permalinks['attribute_base']) . sanitize_title($tax->attribute_name), 'with_front' => false, 'hierarchical' => true);
                 }
                 register_taxonomy($name, apply_filters("woocommerce_taxonomy_objects_{$name}", array('product')), apply_filters("woocommerce_taxonomy_args_{$name}", $taxonomy_data));
             }
         }
         do_action('woocommerce_after_register_taxonomy');
     }
 }
开发者ID:flasomm,项目名称:Montkailash,代码行数:32,代码来源:class-wc-post-types.php


示例8: attribute_taxonomies

 public static function attribute_taxonomies()
 {
     global $woocommerce;
     if (!isset($woocommerce)) {
         return array();
     }
     $attributes = array();
     if (function_exists('wc_get_attribute_taxonomies') && function_exists('wc_attribute_taxonomy_name')) {
         $attribute_taxonomies = wc_get_attribute_taxonomies();
         if (empty($attribute_taxonomies)) {
             return array();
         }
         foreach ($attribute_taxonomies as $attribute) {
             $tax = wc_attribute_taxonomy_name($attribute->attribute_name);
             if (taxonomy_exists($tax)) {
                 $attributes[$tax] = ucfirst($attribute->attribute_name);
             }
         }
     } else {
         $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
         if (empty($attribute_taxonomies)) {
             return array();
         }
         foreach ($attribute_taxonomies as $attribute) {
             $tax = $woocommerce->attribute_taxonomy_name($attribute->attribute_name);
             if (taxonomy_exists($tax)) {
                 $attributes[$tax] = ucfirst($attribute->attribute_name);
             }
         }
     }
     return $attributes;
 }
开发者ID:GaryJones,项目名称:goombiel,代码行数:32,代码来源:class.yith-woocompare-helper.php


示例9: pf_init_attribute_image

 public function pf_init_attribute_image()
 {
     global $woocommerce, $_wp_additional_image_sizes;
     $screen = get_current_screen();
     if (strpos($screen->id, 'pa_') !== false) {
         $this->taxonomy = $_REQUEST['taxonomy'];
         if (taxonomy_exists($_REQUEST['taxonomy'])) {
             $term_id = term_exists(isset($_REQUEST['tag_ID']) ? $_REQUEST['tag_ID'] : 0, $_REQUEST['taxonomy']);
             $term = 0;
             if ($term_id) {
                 $term = get_term($term_id, $_REQUEST['taxonomy']);
             }
             $this->image_size = apply_filters('woocommerce_get_pf_thumbs_image_size', $this->image_size, $_REQUEST['taxonomy'], $term_id);
         }
         $the_size = isset($_wp_additional_image_sizes[$this->image_size]) ? $_wp_additional_image_sizes[$this->image_size] : $_wp_additional_image_sizes['shop_thumbnail'];
         if (isset($the_size['width']) && isset($the_size['height'])) {
             $this->image_width = $the_size['width'];
             $this->image_height = $the_size['height'];
         } else {
             $this->image_width = 32;
             $this->image_height = 32;
         }
         $attribute_taxonomies = wc_get_attribute_taxonomies();
         if ($attribute_taxonomies) {
             foreach ($attribute_taxonomies as $tax) {
                 add_action('pa_' . $tax->attribute_name . '_add_form_fields', array(&$this, 'pf_add_attribute_image'), 10, 2);
                 add_action('pa_' . $tax->attribute_name . '_edit_form_fields', array(&$this, 'pf_edit_attribute_image'), 10, 2);
                 add_filter('manage_edit-pa_' . $tax->attribute_name . '_columns', array(&$this, 'pf_attribute_columns'));
                 add_filter('manage_pa_' . $tax->attribute_name . '_custom_column', array(&$this, 'pf_attribute_column'), 10, 3);
             }
         }
     }
 }
开发者ID:ardiqghenatya,项目名称:web4,代码行数:33,代码来源:pf-attribute-thumbnails.php


示例10: init_form_fields

 public function init_form_fields()
 {
     global $woocommerce;
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     $args = array('data_hook' => sanitize_text_field($_POST[$this->plugin_id . '_data_hook']) ?: get_option($this->plugin_id . '_data_hook'), 'dom_selector' => sanitize_text_field($_POST[$this->plugin_id . '_dom_selector']) ?: get_option($this->plugin_id . '_dom_selector'), 'data_selector' => sanitize_text_field($_POST[$this->plugin_id . '_data_selector']) ?: get_option($this->plugin_id . '_data_selector'));
     $this->form_fields = array('data_hook' => array('title' => __('<b>Place holder for variation data</b>', 'mp_wc_vdopp'), 'description' => __('Choose a CSS class or id where you want to hook variation data. For instance: .variations or .product_meta. Default value: .variations', 'mp_wc_vdopp'), 'type' => 'text', 'default' => $args['data_hook']), 'dom_selector' => array('title' => __('<b>DOM Selector</b>', 'mp_wc_vdopp'), 'description' => __('Define the selector that will trigger show data event. Default value: form.cart select', 'mp_wc_vdopp'), 'type' => 'text', 'default' => $args['dom_selector']), 'data_selector' => array('title' => __('<b>Data Selector</b>', 'mp_wc_vdopp'), 'description' => __('Choose the id/class of displayed data. Default value: .product_details', 'mp_wc_vdopp'), 'type' => 'text', 'default' => $args['data_selector']));
 }
开发者ID:nicolas-thompson,项目名称:heni,代码行数:7,代码来源:class-mp-wc-vdopp-settings.php


示例11: wc_get_attribute_taxonomies

 public static function wc_get_attribute_taxonomies()
 {
     global $woocommerce;
     if (self::is_wc_version_gte_2_1()) {
         return wc_get_attribute_taxonomies();
     } else {
         return $woocommerce->get_attribute_taxonomies();
     }
 }
开发者ID:AndyA,项目名称:River,代码行数:9,代码来源:class-wc-swatches-compatibility.php


示例12: wc_get_attribute_taxonomy_names

/**
 * Get an array of product attribute taxonomies.
 *
 * @access public
 * @return array
 */
function wc_get_attribute_taxonomy_names()
{
    $taxonomy_names = array();
    $attribute_taxonomies = wc_get_attribute_taxonomies();
    if ($attribute_taxonomies) {
        foreach ($attribute_taxonomies as $tax) {
            $taxonomy_names[] = wc_attribute_taxonomy_name($tax->attribute_name);
        }
    }
    return $taxonomy_names;
}
开发者ID:uwitec,项目名称:findgreatmaster,代码行数:17,代码来源:wc-attribute-functions.php


示例13: br_aapf_get_attributes

 /**
  * Get all possible woocommerce attribute taxonomies
  *
  * @return mixed|void
  */
 function br_aapf_get_attributes()
 {
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     $attributes = array();
     if ($attribute_taxonomies) {
         foreach ($attribute_taxonomies as $tax) {
             $attributes[wc_attribute_taxonomy_name($tax->attribute_name)] = $tax->attribute_label;
         }
     }
     return apply_filters('berocket_aapf_get_attributes', $attributes);
 }
开发者ID:kalaveras,项目名称:awaProject,代码行数:16,代码来源:functions.php


示例14: adminAssets

 function adminAssets()
 {
     if (!$this->ourPage()) {
         return;
     }
     wp_enqueue_style('wc-attribute-sets', $this->url . '/assets/css/wc-attribute-sets.css');
     // Registers and adds the required assets to admin pages
     wp_enqueue_script('wc-attribute-sets-angularjs', $this->url . '/assets/js/angular.min.js', null, null, false);
     wp_enqueue_script('wc-attribute-sets-angularjs-route', $this->url . '/assets/js/angular-route.min.js', array('wc-attribute-sets-angularjs'), null, false);
     wp_enqueue_script('wc-attribute-sets-app', $this->url . '/assets/js/wc-attribute-sets-app.js', array('wc-attribute-sets-angularjs-route'), 1.0, false);
     wp_localize_script('wc-attribute-sets-app', 'wcAttributeSets', array('productsAttributes' => wc_get_attribute_taxonomies(), 'viewsUrl' => $this->url . '/views/app/', 'ajaxUrl' => admin_url('admin-ajax.php')));
 }
开发者ID:galalaly,项目名称:wc-attribute-sets,代码行数:12,代码来源:wc-attribute-sets.php


示例15: manageAttrLablesTranslation

 /**
  * Make all attributes lables managed by polylang string translation
  *
  * @global \Polylang $polylang
  * @global \WooCommerce $woocommerce
  *
  * @return boolean false if polylang or woocommerce can not be found
  */
 public function manageAttrLablesTranslation()
 {
     global $polylang, $woocommerce;
     if (!$polylang || !$woocommerce) {
         return false;
     }
     $attrs = wc_get_attribute_taxonomies();
     $section = __('Woocommerce Attributes', 'woo-poly-integration');
     foreach ($attrs as $attr) {
         pll_register_string($attr->attribute_label, $attr->attribute_label, $section);
     }
 }
开发者ID:Frost-Bite,项目名称:woo-poly-integration,代码行数:20,代码来源:Attributes.php


示例16: init_settings

 /**
  * Init settings after post types are registered.
  */
 public function init_settings()
 {
     $attribute_array = array();
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     if ($attribute_taxonomies) {
         foreach ($attribute_taxonomies as $tax) {
             if (taxonomy_exists(wc_attribute_taxonomy_name($tax->attribute_name))) {
                 $attribute_array[$tax->attribute_name] = $tax->attribute_name;
             }
         }
     }
     $this->settings = array('title' => array('type' => 'text', 'std' => __('Filter by', 'woocommerce'), 'label' => __('Title', 'woocommerce')), 'attribute' => array('type' => 'select', 'std' => '', 'label' => __('Attribute', 'woocommerce'), 'options' => $attribute_array), 'display_type' => array('type' => 'select', 'std' => 'list', 'label' => __('Display type', 'woocommerce'), 'options' => array('list' => __('List', 'woocommerce'), 'dropdown' => __('Dropdown', 'woocommerce'))), 'query_type' => array('type' => 'select', 'std' => 'and', 'label' => __('Query type', 'woocommerce'), 'options' => array('and' => __('AND', 'woocommerce'), 'or' => __('OR', 'woocommerce'))));
 }
开发者ID:matthewduhig,项目名称:woocommerce,代码行数:16,代码来源:class-wc-widget-layered-nav.php


示例17: get_woo_attribute_taxonomies

 protected function get_woo_attribute_taxonomies()
 {
     $attribute_array = array();
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     if ($attribute_taxonomies) {
         foreach ($attribute_taxonomies as $tax) {
             if (taxonomy_exists(wc_attribute_taxonomy_name($tax->attribute_name))) {
                 $attribute_array[$tax->attribute_name] = $tax->attribute_name;
             }
         }
     }
     return $attribute_array;
 }
开发者ID:jmead,项目名称:trucell-cms,代码行数:13,代码来源:class.php


示例18: pw_attribute_image

function pw_attribute_image()
{
    global $woocommerce, $_wp_additional_image_sizes;
    $screen = get_current_screen();
    $attribute_taxonomies = wc_get_attribute_taxonomies();
    if ($attribute_taxonomies) {
        foreach ($attribute_taxonomies as $tax) {
            add_action('pa_' . $tax->attribute_name . '_add_form_fields', 'pw_add_attribute_image', 10, 2);
            add_action('pa_' . $tax->attribute_name . '_edit_form_fields', 'pw_edit_att_image', 10, 2);
            add_filter('manage_edit-pa_' . $tax->attribute_name . '_columns', 'pw_attribute_columns');
            add_filter('manage_pa_' . $tax->attribute_name . '_custom_column', 'pw_attribute_column', 10, 3);
        }
    }
}
开发者ID:hikaram,项目名称:wee,代码行数:14,代码来源:taxonomy_attribute.php


示例19: wcva_setup_texonomy_based_fields

 public function wcva_setup_texonomy_based_fields()
 {
     global $woocommerce;
     $woo_version = wcva_get_woo_version_number();
     if ($woo_version < 2.1) {
         $createdattributes = $woocommerce->get_attribute_taxonomies();
     } else {
         $createdattributes = wc_get_attribute_taxonomies();
     }
     foreach ($createdattributes as $attribute) {
         add_action('pa_' . $attribute->attribute_name . '_add_form_fields', array($this, 'add_category_fields'));
         add_action('pa_' . $attribute->attribute_name . '_edit_form_fields', array($this, 'edit_category_fields'), 10, 2);
         add_filter('manage_edit-pa_' . $attribute->attribute_name . '_columns', array($this, 'term_columns'));
         add_filter('manage_pa_' . $attribute->attribute_name . '_custom_column', array($this, 'term_column'), 10, 3);
     }
 }
开发者ID:alikagitci,项目名称:honda.yedekleri,代码行数:16,代码来源:class_attribute_global_values.php


示例20: __construct

 /**
  * Constructor
  *
  * @param WC_Variation_Restrictions $instance
  */
 public function __construct()
 {
     add_filter('woocommerce_products_general_settings', array($this, 'Settings'));
     // Category restriction settings
     add_action("product_cat_edit_form_fields", array($this, 'EditProductCategory'));
     add_action("edit_product_cat", array($this, 'SaveProductCategory'));
     // Product attribute/variation restriction setings
     $attribute_taxonomies = wc_get_attribute_taxonomies();
     if ($attribute_taxonomies) {
         foreach ($attribute_taxonomies as $tax) {
             // For each of WooCommerce's custom product attributes
             $attribute_name = wc_attribute_taxonomy_name($tax->attribute_name);
             add_action("{$attribute_name}_edit_form_fields", array($this, 'EditAttributeTerm'));
             add_action("edit_{$attribute_name}", array($this, 'SaveAttributeTerm'), 10, 2);
         }
     }
 }
开发者ID:OM4,项目名称:WooCommerce-Product-Restrictions,代码行数:22,代码来源:WC_Product_Restrictions_Admin.php



注:本文中的wc_get_attribute_taxonomies函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wc_get_attribute_taxonomy_names函数代码示例发布时间:2022-05-23
下一篇:
PHP wc_format_refund_total函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap