当前位置: 首页>>代码示例>>PHP>>正文


PHP kt_add_category函数代码示例

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


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

示例1: kt_add_category

kt_add_category(188, 'Silver', 'silver', 'pa_material', '0', '');
kt_add_category(2, 'simple', 'simple', 'product_type', '0', '');
kt_add_category(56, 'style', 'style', 'product_tag', '0', '');
kt_add_brand(57, 'Super', 'super', 'product_brand', '0', 'Whatever the occasion, complete your outfit with one of Hermes Fashion’s stylish women’s bags. Discover our spring collection.', '1048');
kt_add_category(58, 'transparent', 'transparent', 'product_tag', '0', '');
kt_add_category(4, 'variable', 'variable', 'product_type', '0', '');
kt_add_category(59, 'wash', 'wash', 'product_tag', '0', '');
kt_add_category(60, 'women', 'women', 'product_tag', '0', '');
kt_add_category(61, 'Woo', 'woo', 'product_tag', '0', '');
kt_add_category(183, 'Wood', 'wood', 'pa_material', '0', '');
kt_add_category(62, 'X', 'x', 'pa_size', '0', '');
kt_add_category(63, 'XL', 'xl', 'pa_size', '0', '');
kt_add_category(64, 'XS', 'xs', 'pa_size', '0', '');
kt_add_category(65, 'XXL', 'xxl', 'pa_size', '0', '');
kt_add_category(66, 'XXS', 'xxs', 'pa_size', '0', '');
kt_add_category(182, 'Yellow', 'yellow', 'pa_color', '0', '');
kt_add_product_cat(82, 'Digital', 'digital', 'product_cat', '0', '', '463');
kt_add_product_cat(85, 'Accessories for iPad', 'accessories-for-ipad', 'product_cat', '82', '', '');
kt_add_product_cat(84, 'Accessories for iPhone', 'accessories-for-iphone', 'product_cat', '82', '', '');
kt_add_product_cat(86, 'Accessories for Tablet PC', 'accessories-for-tablet-pc', 'product_cat', '82', '', '');
kt_add_product_cat(121, 'Camera', 'camera', 'product_cat', '82', '', '');
kt_add_product_cat(68, 'Cameras & Photo', 'cameras-photo', 'product_cat', '82', '', '0');
kt_add_product_cat(69, 'Computers & Networking', 'computers-networking', 'product_cat', '82', '', '0');
kt_add_product_cat(132, 'Laptop', 'laptop', 'product_cat', '82', '', '');
kt_add_product_cat(134, 'Mobile', 'mobile', 'product_cat', '82', '', '');
kt_add_product_cat(136, 'Notebook', 'notebook', 'product_cat', '82', '', '');
kt_add_product_cat(74, 'Smartphone & Tablets', 'smartphone-tablets', 'product_cat', '82', '', '0');
kt_add_product_cat(76, 'Television', 'television-2', 'product_cat', '82', '', '0');
kt_add_product_cat(87, 'Electronic', 'electronic', 'product_cat', '0', '', '462');
kt_add_product_cat(117, 'Air Conditional', 'air-conditional', 'product_cat', '87', '', '');
kt_add_product_cat(118, 'ARM', 'arm', 'product_cat', '87', '', '');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:31,代码来源:term.php

示例2: kt_add_category

kt_add_category(24, 'comfort', 'comfort', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(5, 'external', 'external', 'product_type', '0', '');
kt_add_brand(25, 'Git', 'git', 'product_brand', '0', '', '836');
kt_add_category(3, 'grouped', 'grouped', 'product_type', '0', '');
kt_add_category(27, 'long', 'long', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit,');
kt_add_category(28, 'modern', 'modern', 'product_tag', '0', 'Quisque velit nisi, pretium ut lacinia in, elementum id enim. Curabitur non nulla sit amet nisl tempus convallis quis ac lectus');
kt_add_category(29, 'morden', 'morden', 'product_tag', '0', '');
kt_add_category(30, 'moving', 'moving', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(31, 'new', 'new', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Donec sollicitudin molestie malesuada. Mauris blandit aliquet elit,');
kt_add_category(33, 'playing', 'playing', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(35, 'ruby', 'ruby', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(36, 'sexy', 'sexy', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(37, 'short', 'short', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(2, 'simple', 'simple', 'product_type', '0', '');
kt_add_category(38, 'style', 'style', 'product_tag', '0', 'Nulla quis lorem ut libero malesuada feugiat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus.');
kt_add_category(4, 'variable', 'variable', 'product_type', '0', '');
kt_add_product_cat(39, 'Digital', 'digital', 'product_cat', '0', '', '');
kt_add_product_cat(40, 'Fashion', 'fashion', 'product_cat', '0', '', '');
kt_add_product_cat(41, 'Foods', 'foods', 'product_cat', '0', '', '');
kt_add_product_cat(42, 'Furniture', 'furniture', 'product_cat', '0', '', '');
kt_add_product_cat(43, 'Jewelry', 'jewelry', 'product_cat', '0', '', '');
kt_add_product_cat(44, 'Laptop', 'laptop', 'product_cat', '39', '', '');
kt_add_product_cat(45, 'Mobile', 'mobile', 'product_cat', '39', '', '');
kt_add_product_cat(46, 'Notebook', 'notebook', 'product_cat', '39', '', '');
kt_add_product_cat(47, 'Sport shirt', 'sport-shirt', 'product_cat', '0', 'Nullam aliquet vestibulum augue non varius. Cras nec congue elitos. Duis tristique del ante nec aliquam. Praesent urna tellus laoreet.
                    ', '855');
kt_add_product_cat(48, 'Sport shoes', 'sport-shoes', 'product_cat', '0', 'Nullam aliquet vestibulum augue non varius. Cras nec congue elitos. Duis tristique del ante nec aliquam. Praesent urna tellus laoreet.
                    ', '855');
kt_add_product_cat(49, 'Sport Trouser', 'sport-trouser', 'product_cat', '0', 'Nullam aliquet vestibulum augue non varius. Cras nec congue elitos. Duis tristique del ante nec aliquam. Praesent urna tellus laoreet.
                    ', '858');
kt_add_product_cat(50, 'Sports', 'sports', 'product_cat', '0', '', '');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:31,代码来源:o9.php

示例3: kt_add_category

kt_add_category(40, 'style', 'style', 'product_tag', '0', '');
kt_add_brand(41, 'Super', 'super', 'product_brand', '0', 'Whatever the occasion, complete your outfit with one of Hermes Fashion’s stylish women’s bags. Discover our spring collection.', '');
kt_add_category(42, 'transparent', 'transparent', 'product_tag', '0', '');
kt_add_category(4, 'variable', 'variable', 'product_type', '0', '');
kt_add_category(151, 'Violet', 'violet', 'pa_color', '0', '');
kt_add_category(43, 'wash', 'wash', 'product_tag', '0', '');
kt_add_category(44, 'women', 'women', 'product_tag', '0', '');
kt_add_category(45, 'Woo', 'woo', 'product_tag', '0', '');
kt_add_category(165, 'Wood', 'wood', 'pa_material', '0', '');
kt_add_category(154, 'X', 'x', 'pa_size', '0', '');
kt_add_category(156, 'XL', 'xl', 'pa_size', '0', '');
kt_add_category(157, 'XS', 'xs', 'pa_size', '0', '');
kt_add_category(158, 'XXL', 'xxl', 'pa_size', '0', '');
kt_add_category(159, 'XXS', 'xxs', 'pa_size', '0', '');
kt_add_category(148, 'Yellow', 'yellow', 'pa_color', '0', '');
kt_add_category(188, 'yellow', 'yellow', 'pa_weight', '0', '');
kt_add_product_cat(189, 'Auto Access', 'auto-access', 'product_cat', '0', '', '0');
kt_add_product_cat(46, 'Digital', 'digital', 'product_cat', '0', '', '0');
kt_add_product_cat(47, 'Electronic', 'electronic', 'product_cat', '0', '', '');
kt_add_product_cat(48, 'Fashion', 'fashion', 'product_cat', '0', '', '0');
kt_add_product_cat(49, 'Flashlights & Lamps', 'flashlights-lamps', 'product_cat', '47', '', '');
kt_add_product_cat(50, 'Foods', 'foods', 'product_cat', '0', '', '');
kt_add_product_cat(51, 'Furniture', 'furniture', 'product_cat', '0', '', '0');
kt_add_product_cat(52, 'Headphone, Headset', 'headphone-headset-electronic', 'product_cat', '47', '', '');
kt_add_product_cat(106, 'Health & Beauty', 'health-beauty', 'product_cat', '48', '', '0');
kt_add_product_cat(53, 'Health & Beauty Bags', 'health-beauty-bags', 'product_cat', '48', '', '');
kt_add_product_cat(54, 'Home Audio', 'home-audio-electronic', 'product_cat', '47', '', '');
kt_add_product_cat(217, 'Home Storage', 'home-storage', 'product_cat', '51', '', '0');
kt_add_product_cat(221, 'Home Style', 'home-style', 'product_cat', '51', '', '0');
kt_add_product_cat(243, 'Ipad Air', 'ipad-air', 'product_cat', '46', '', '0');
kt_add_product_cat(238, 'Jean', 'jean', 'product_cat', '48', '', '0');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:31,代码来源:term.php

示例4: kt_add_category

kt_add_category(205, 'hair', 'hair', 'post_tag', '0', '');
kt_add_category(200, 'Hairstyles', 'hairstyles', 'post_tag', '0', '');
kt_add_category(202, 'Kendall Wears', 'kendall-wears', 'post_tag', '0', '');
kt_add_category(209, 'Kuteshop', 'kuteshop', 'post_tag', '0', '');
kt_add_category(216, 'Loss', 'loss', 'post_tag', '0', '');
kt_add_category(215, 'love', 'love', 'post_tag', '0', '');
kt_add_category(210, 'love with fashion', 'love-with-fashion', 'post_tag', '0', '');
kt_add_category(204, 'Make', 'make', 'post_tag', '0', '');
kt_add_category(197, 'Meal Planss', 'meal-planss', 'post_tag', '0', '');
kt_add_category(213, 'omnis', 'omnis', 'post_tag', '0', '');
kt_add_category(218, 'Rings', 'rings', 'post_tag', '0', '');
kt_add_category(214, 'shop', 'shop', 'post_tag', '0', '');
kt_add_category(207, 'shop with us', 'shop-with-us', 'post_tag', '0', '');
kt_add_category(208, 'summer', 'summer', 'post_tag', '0', '');
kt_add_category(206, 'unde omnis', 'unde-omnis', 'post_tag', '0', '');
kt_add_category(199, 'Unique', 'unique', 'post_tag', '0', '');
// Attachment
kt_download_media(2003, '1', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/1.jpg');
kt_download_media(2004, '2', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/2.jpg');
kt_download_media(2005, '3', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/3.jpg');
kt_download_media(2006, '4', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/4.jpg');
kt_download_media(2007, '5', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/5.jpg');
kt_download_media(2008, '6', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/6.jpg');
kt_download_media(2009, '7', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/7.jpg');
kt_download_media(2011, '8', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/8.jpg');
kt_download_media(2012, '9', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/9.jpg');
kt_download_media(2013, '10', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/10.jpg');
kt_download_media(2014, '11', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/11.jpg');
kt_download_media(2033, '24', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/24.jpg');
kt_download_media(2037, '29', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/29.jpg');
kt_download_media(2040, '31', 'http://kutethemes.net/wordpress/kuteshop/option13/wp-content/uploads/2015/08/31.jpg');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:31,代码来源:o13.php

示例5: kt_add_category

<?php

// Categories
kt_add_category(6, 'About beauty', 'about-beauty', 'category', '0', '');
kt_add_category(7, 'Baby &amp; Mum', 'baby-mum', 'category', '0', '');
kt_add_category(8, 'Diet &amp; Fitness', 'diet-fitness', 'category', '0', '');
kt_add_category(9, 'News', 'news', 'category', '0', '');
kt_add_category(10, 'Promotions', 'promotions', 'category', '0', '');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:8,代码来源:category.php

示例6: kt_add_category

<?php

// Tag
kt_add_category(207, 'Buy', 'buy', 'post_tag', '0', '');
kt_add_category(206, 'Celebrity', 'celebrity', 'post_tag', '0', '');
kt_add_category(208, 'Concert', 'concert', 'post_tag', '0', '');
kt_add_category(214, 'fashion', 'fashion', 'post_tag', '0', '');
kt_add_category(205, 'Hair', 'hair', 'post_tag', '0', '');
kt_add_category(209, 'Hungrier', 'hungrier', 'post_tag', '0', '');
kt_add_category(202, 'Meal', 'meal', 'post_tag', '0', '');
kt_add_category(210, 'omnis', 'omnis', 'post_tag', '0', '');
kt_add_category(203, 'Plus', 'plus', 'post_tag', '0', '');
kt_add_category(204, 'Rings', 'rings', 'post_tag', '0', '');
kt_add_category(213, 'Share', 'share', 'post_tag', '0', '');
kt_add_category(211, 'shop', 'shop', 'post_tag', '0', '');
kt_add_category(212, 'summer', 'summer', 'post_tag', '0', '');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:16,代码来源:tag.php

示例7: kt_add_category

kt_add_category(60, 'pearl', 'pearl', 'product_tag', '0', '');
kt_add_category(62, 'picture', 'picture', 'product_tag', '0', '');
kt_add_category(65, 'playing', 'playing', 'product_tag', '0', '');
kt_add_category(66, 'pretty', 'pretty', 'product_tag', '0', '');
kt_add_brand(67, 'Pumano', 'pumano', 'product_brand', '0', 'Whatever the occasion, complete your outfit with one of Hermes Fashion’s stylish women’s bags. Discover our spring collection.', '2053');
kt_add_category(70, 'Ruby', 'ruby', 'product_tag', '0', '');
kt_add_category(72, 'sexy', 'sexy', 'product_tag', '0', '');
kt_add_category(73, 'short', 'short', 'product_tag', '0', '');
kt_add_category(2, 'simple', 'simple', 'product_type', '0', '');
kt_add_category(75, 'style', 'style', 'product_tag', '0', '');
kt_add_brand(76, 'Super', 'super', 'product_brand', '0', 'Whatever the occasion, complete your outfit with one of Hermes Fashion’s stylish women’s bags. Discover our spring collection.', '2055');
kt_add_category(77, 'transparent', 'transparent', 'product_tag', '0', '');
kt_add_category(4, 'variable', 'variable', 'product_type', '0', '');
kt_add_category(78, 'wash', 'wash', 'product_tag', '0', '');
kt_add_category(79, 'women', 'women', 'product_tag', '0', '');
kt_add_category(80, 'Woo', 'woo', 'product_tag', '0', '');
kt_add_product_cat(88, 'Digital', 'digital', 'product_cat', '0', '', '');
kt_add_product_cat(89, 'Electronic', 'electronic', 'product_cat', '0', '', '');
kt_add_product_cat(90, 'Fashion', 'fashion', 'product_cat', '0', '', '');
kt_add_product_cat(91, 'Flashlights &amp; Lamps', 'flashlights-lamps', 'product_cat', '89', '', '');
kt_add_product_cat(92, 'Foods', 'foods', 'product_cat', '0', '', '');
kt_add_product_cat(93, 'Furniture', 'furniture', 'product_cat', '0', '', '');
kt_add_product_cat(94, 'Headphone, Headset', 'headphone-headset-electronic', 'product_cat', '89', '', '');
kt_add_product_cat(95, 'Health &amp; Beauty Bags', 'health-beauty-bags', 'product_cat', '90', '', '');
kt_add_product_cat(96, 'Home Audio', 'home-audio-electronic', 'product_cat', '89', '', '');
kt_add_product_cat(97, 'Jewelry', 'jewelry', 'product_cat', '0', '', '');
kt_add_product_cat(98, 'Jewelry &amp; Watches', 'jewelry-watches', 'product_cat', '97', '', '');
kt_add_product_cat(99, 'Kid\'s', 'kids', 'product_cat', '90', '', '');
kt_add_product_cat(100, 'Laptop', 'laptop', 'product_cat', '88', '', '');
kt_add_product_cat(101, 'Loveseats', 'loveseats', 'product_cat', '93', '', '');
kt_add_product_cat(102, 'Men Watches', 'men-watches', 'product_cat', '98', '', '');
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:31,代码来源:o8.php

示例8: kt_add_category

<?php

// Categories
kt_add_category(6, 'About Beauty', 'about-beauty', 'category', '0', '');
kt_add_category(7, 'Baby &amp; Mum', 'baby-mum', 'category', '0', '');
kt_add_category(8, 'Diet &amp; Fitness', 'diet-fitness', 'category', '0', '');
kt_add_category(9, 'News', 'news', 'category', '0', '');
kt_add_category(10, 'Promotions', 'promotions', 'category', '0', '');
kt_add_category(1, 'Uncategorized', 'uncategorized', 'category', '0', '');
开发者ID:seanndlovu,项目名称:kutetheme-wp,代码行数:9,代码来源:category.php

示例9: kt_add_product_cat

kt_add_product_cat(204, 'Hiking Shoes', 'hiking-shoes', 'product_cat', '73', '', '0');
kt_add_product_cat(108, 'Jackets', 'jackets', 'product_cat', '61', '', '');
kt_add_product_cat(109, 'Outdoor Supplies', 'outdoor-traveling-supplies', 'product_cat', '73', '', '0');
kt_add_product_cat(72, 'Sport &amp; Outdoors', 'sport-outdoor', 'product_cat', '73', '', '0');
// Tag
kt_add_category(229, 'Clothing', 'clothing', 'post_tag', '0', '');
kt_add_category(235, 'Concert', 'concert', 'post_tag', '0', '');
kt_add_category(228, 'Cute', 'cute', 'post_tag', '0', '');
kt_add_category(230, 'Engagament', 'engagament', 'post_tag', '0', '');
kt_add_category(226, 'Fashion', 'fashion', 'post_tag', '0', '');
kt_add_category(232, 'Friendship', 'friendship', 'post_tag', '0', '');
kt_add_category(236, 'Healthy', 'healthy', 'post_tag', '0', '');
kt_add_category(234, 'Kendall', 'kendall', 'post_tag', '0', '');
kt_add_category(227, 'Make up', 'make-up', 'post_tag', '0', '');
kt_add_category(233, 'Shoes', 'shoes', 'post_tag', '0', '');
kt_add_category(231, 'Short Hair', 'short-hair', 'post_tag', '0', '');
// Attachment
kt_download_media(2173, 'logo', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/10/logo.png');
kt_download_media(2174, 'logo2', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/10/logo2.png');
kt_download_media(2176, 'size-chart', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/size-chart.jpg');
kt_download_media(2238, '2', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/2.jpg');
kt_download_media(2239, '2', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/21.jpg');
kt_download_media(2240, '3', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/3.jpg');
kt_download_media(2241, '3---Copy', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/3-Copy.jpg');
kt_download_media(2242, '4', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/4.jpg');
kt_download_media(2243, '5', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/5.jpg');
kt_download_media(2244, '6', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/6.jpg');
kt_download_media(2245, '7', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/7.jpg');
kt_download_media(2246, '8', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/8.jpg');
kt_download_media(2247, '9', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/9.jpg');
kt_download_media(2248, '10', 'http://kutethemes.net/wordpress/kuteshop/option7/wp-content/uploads/2015/08/10.jpg');
开发者ID:seanndlovu,项目名称:kutetheme-wp,代码行数:31,代码来源:justanotherwordpresssite.wordpress.2015-12-25.php

示例10: kt_add_product_cat

/**
 * Add Product Cat
 * 
 * @since 1.0
 * 
 * @param $term_id
 * @param $name
 * @param $slug
 * @param $taxonomy
 * @param $parent
 * @param $description
 * @param $thumbnail
 */
function kt_add_product_cat($term_id, $name, $slug, $taxonomy, $parent, $description, $thumbnail = 0)
{
    global $categories_id;
    $new_cat_id = kt_get_cate_id($term_id);
    if (!$new_cat_id) {
        //all categories
        $ids = $categories_id;
        if (!taxonomy_exists($taxonomy)) {
            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))));
        }
        if (!$parent) {
            $new_cat_id = wp_insert_term($name, $taxonomy, array('description' => $description, 'slug' => $slug, 'parent' => $ids[$parent]));
        } else {
            if ($ids[$parent]) {
                $new_cat_id = wp_insert_term($name, $taxonomy, array('description' => $description, 'slug' => $slug, 'parent' => $ids[$parent]));
            } else {
                //The categoy have been waiting
                $cate_add_after = get_option('kt_demo_categories_add_before');
                if ($cate_add_after && count($cate_add_after)) {
                    foreach ($cate_add_after as $after) {
                        kt_add_category($after);
                    }
                }
                $cate_add_after[] = $cat;
                update_option('kt_demo_categories_add_before', $cate_add_after);
            }
        }
        if (!is_wp_error($new_cat_id)) {
            if (is_array($new_cat_id) && isset($new_cat_id['term_id'])) {
                $ids[$term_id] = array('id' => $new_cat_id['term_id'], 'tax' => $taxonomy);
            } else {
                $ids[$term_id] = array('id' => $new_cat_id, 'tax' => $taxonomy);
            }
            $categories_id = $ids;
            update_option('kt_demo_categories', $categories_id);
            //Update thumbnail
            if ($thumbnail) {
                $thumnail_id = kt_get_post_id($thumbnail, 'attachment', 'kt_demo_attachment');
                if (function_exists('add_woocommerce_term_meta')) {
                    return add_woocommerce_term_meta($new_cat_id['term_id'], 'thumbnail_id', $thumnail_id, false);
                } else {
                    return add_metadata('woocommerce_term', $new_cat_id['term_id'], 'thumbnail_id', $thumnail_id, false);
                }
            }
        } else {
            return;
        }
    }
    return $new_cat_id;
}
开发者ID:acamboy,项目名称:kutetheme-wp,代码行数:63,代码来源:utility.php


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