Нет описания

visual-composer.php 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <?php
  2. function berocket_apl_vc_before_init() {
  3. if( class_exists('WPBakeryShortCode') && function_exists('vc_map') ) {
  4. class WPBakeryShortCode_brands_by_name extends WPBakeryShortCode {
  5. }
  6. vc_map( array(
  7. 'base' => 'brands_by_name',
  8. 'name' => __( 'Brands by Name', 'brands-for-woocommerce' ),
  9. 'class' => '',
  10. 'category' => __( 'BeRocket', 'brands-for-woocommerce' ),
  11. 'icon' => 'icon-heart',
  12. 'params' => array(
  13. array(
  14. 'type' => 'checkbox',
  15. 'heading' => __( 'Image', 'brands-for-woocommerce' ),
  16. 'param_name' => 'image',
  17. 'value' => array(__('Display image', 'brands-for-woocommerce') => '1'),
  18. ),
  19. array(
  20. 'type' => 'checkbox',
  21. 'heading' => __( 'Name', 'brands-for-woocommerce' ),
  22. 'param_name' => 'text',
  23. 'value' => array(__('Hide name', 'brands-for-woocommerce') => '0'),
  24. ),
  25. array(
  26. 'type' => 'textfield',
  27. 'heading' => __( 'Maximum image height', 'brands-for-woocommerce' ),
  28. 'param_name' => 'imgh',
  29. 'value' => '64px',
  30. ),
  31. array(
  32. 'type' => 'textfield',
  33. 'heading' => __( 'Maximum image width', 'brands-for-woocommerce' ),
  34. 'param_name' => 'imgw',
  35. 'value' => '',
  36. ),
  37. array(
  38. 'type' => 'textfield',
  39. 'heading' => __( 'Columns', 'brands-for-woocommerce' ),
  40. 'param_name' => 'column',
  41. 'value' => '2',
  42. ),
  43. array(
  44. 'type' => 'dropdown',
  45. 'heading' => __( 'Position', 'brands-for-woocommerce' ),
  46. 'param_name' => 'position',
  47. 'value' => array(
  48. __('Name after image', 'brands-for-woocommerce') => '1',
  49. __('Name before image', 'brands-for-woocommerce') => '2',
  50. __('Name under image', 'brands-for-woocommerce') => '3',
  51. ),
  52. ),
  53. array(
  54. 'type' => 'dropdown',
  55. 'heading' => __( 'Style', 'brands-for-woocommerce' ),
  56. 'param_name' => 'style',
  57. 'value' => array(
  58. __('Vertical', 'brands-for-woocommerce') => 'vertical',
  59. __('Horizontal', 'brands-for-woocommerce') => 'horizontal',
  60. ),
  61. ),
  62. ),
  63. ) );
  64. class WPBakeryShortCode_brands_list extends WPBakeryShortCode {
  65. }
  66. vc_map( array(
  67. 'base' => 'brands_list',
  68. 'name' => __( 'Brands List', 'brands-for-woocommerce' ),
  69. 'class' => '',
  70. 'category' => __( 'BeRocket', 'brands-for-woocommerce' ),
  71. 'icon' => 'icon-heart',
  72. 'params' => array(
  73. array(
  74. 'type' => 'textfield',
  75. 'heading' => __( 'Title', 'brands-for-woocommerce' ),
  76. 'param_name' => 'title',
  77. 'value' => '',
  78. ),
  79. array(
  80. 'type' => 'checkbox',
  81. 'heading' => __( 'Image', 'brands-for-woocommerce' ),
  82. 'param_name' => 'use_image',
  83. 'value' => array(__('Hide image', 'brands-for-woocommerce') => '0'),
  84. ),
  85. array(
  86. 'type' => 'textfield',
  87. 'heading' => __( 'Image height', 'brands-for-woocommerce' ),
  88. 'param_name' => 'imgh',
  89. 'value' => '64',
  90. ),
  91. array(
  92. 'type' => 'checkbox',
  93. 'heading' => __( 'Name', 'brands-for-woocommerce' ),
  94. 'param_name' => 'use_name',
  95. 'value' => array(__('Display name', 'brands-for-woocommerce') => '1'),
  96. ),
  97. array(
  98. 'type' => 'checkbox',
  99. 'heading' => __( 'Show empty', 'brands-for-woocommerce' ),
  100. 'param_name' => 'hide_empty',
  101. 'value' => array(__('Show brands without products', 'brands-for-woocommerce') => '0'),
  102. ),
  103. array(
  104. 'type' => 'checkbox',
  105. 'heading' => __( 'Slider', 'brands-for-woocommerce' ),
  106. 'param_name' => 'slider',
  107. 'value' => array(__('Display as slider', 'brands-for-woocommerce') => '1'),
  108. ),
  109. array(
  110. 'type' => 'textfield',
  111. 'heading' => __( 'Brands per row', 'brands-for-woocommerce' ),
  112. 'param_name' => 'per_row',
  113. 'value' => '3',
  114. ),
  115. array(
  116. 'type' => 'textfield',
  117. 'heading' => __( 'Number of brands', 'brands-for-woocommerce' ),
  118. 'param_name' => 'count',
  119. 'value' => '',
  120. ),
  121. array(
  122. 'type' => 'dropdown',
  123. 'heading' => __( 'Order By', 'brands-for-woocommerce' ),
  124. 'param_name' => 'orderby',
  125. 'value' => array(
  126. __('Brand name', 'brands-for-woocommerce') => 'name',
  127. __('Count of products', 'brands-for-woocommerce') => 'count',
  128. ),
  129. ),
  130. array(
  131. 'type' => 'textfield',
  132. 'heading' => __( 'Padding around brands', 'brands-for-woocommerce' ),
  133. 'param_name' => 'padding',
  134. 'value' => '3px',
  135. ),
  136. array(
  137. 'type' => 'colorpicker',
  138. 'heading' => __( 'Border color', 'brands-for-woocommerce' ),
  139. 'param_name' => 'border_color',
  140. 'value' => '',
  141. ),
  142. array(
  143. 'type' => 'textfield',
  144. 'heading' => __( 'Border width', 'brands-for-woocommerce' ),
  145. 'param_name' => 'border_width',
  146. 'value' => '',
  147. ),
  148. ),
  149. ) );
  150. class WPBakeryShortCode_brands_products extends WPBakeryShortCode {
  151. }
  152. vc_map( array(
  153. 'base' => 'brands_products',
  154. 'name' => __( 'Brand Products', 'brands-for-woocommerce' ),
  155. 'class' => '',
  156. 'category' => __( 'BeRocket', 'brands-for-woocommerce' ),
  157. 'icon' => 'icon-heart',
  158. 'params' => array(
  159. array(
  160. 'type' => 'textfield',
  161. 'heading' => __( 'Brand ID(s)', 'brands-for-woocommerce' ),
  162. 'param_name' => 'brand_id',
  163. 'value' => '',
  164. ),
  165. array(
  166. 'type' => 'textfield',
  167. 'heading' => __( 'Brand slug(s)', 'brands-for-woocommerce' ),
  168. 'param_name' => 'brand_slug',
  169. 'value' => '',
  170. ),
  171. array(
  172. 'type' => 'textfield',
  173. 'heading' => __( 'Columns', 'brands-for-woocommerce' ),
  174. 'param_name' => 'columns',
  175. 'value' => '4',
  176. ),
  177. array(
  178. 'type' => 'dropdown',
  179. 'heading' => __( 'Order By', 'brands-for-woocommerce' ),
  180. 'param_name' => 'orderby',
  181. 'value' => array(
  182. __('Title', 'brands-for-woocommerce') => 'title',
  183. __('Post name (post slug)', 'brands-for-woocommerce') => 'name',
  184. __('Date', 'brands-for-woocommerce') => 'date',
  185. __('Modified date', 'brands-for-woocommerce') => 'modified',
  186. __('Random', 'brands-for-woocommerce') => 'rand',
  187. ),
  188. ),
  189. array(
  190. 'type' => 'dropdown',
  191. 'heading' => __( 'Order By', 'brands-for-woocommerce' ),
  192. 'param_name' => 'orderby',
  193. 'value' => array(
  194. __('Descending', 'brands-for-woocommerce') => 'desc',
  195. __('Ascending', 'brands-for-woocommerce') => 'asc',
  196. ),
  197. ),
  198. ),
  199. ) );
  200. class WPBakeryShortCode_brands_info extends WPBakeryShortCode {
  201. }
  202. vc_map( array(
  203. 'base' => 'brands_info',
  204. 'name' => __( 'Brand Info', 'brands-for-woocommerce' ),
  205. 'class' => '',
  206. 'category' => __( 'BeRocket', 'brands-for-woocommerce' ),
  207. 'icon' => 'icon-heart',
  208. 'params' => array(
  209. array(
  210. 'type' => 'textfield',
  211. 'heading' => __( 'Brand ID(s)', 'brands-for-woocommerce' ),
  212. 'param_name' => 'brand_id',
  213. 'value' => '',
  214. ),
  215. array(
  216. 'type' => 'textfield',
  217. 'heading' => __( 'Brand slug(s)', 'brands-for-woocommerce' ),
  218. 'param_name' => 'brand_slug',
  219. 'value' => '',
  220. ),
  221. array(
  222. 'type' => 'textfield',
  223. 'heading' => __( 'Columns', 'brands-for-woocommerce' ),
  224. 'param_name' => 'columns',
  225. 'value' => '4',
  226. ),
  227. array(
  228. 'type' => 'dropdown',
  229. 'heading' => __( 'Order By', 'brands-for-woocommerce' ),
  230. 'param_name' => 'orderby',
  231. 'value' => array(
  232. __('Title', 'brands-for-woocommerce') => 'title',
  233. __('Post name (post slug)', 'brands-for-woocommerce') => 'name',
  234. __('Date', 'brands-for-woocommerce') => 'date',
  235. __('Modified date', 'brands-for-woocommerce') => 'modified',
  236. __('Random', 'brands-for-woocommerce') => 'rand',
  237. ),
  238. ),
  239. array(
  240. 'type' => 'dropdown',
  241. 'heading' => __( 'Order By', 'brands-for-woocommerce' ),
  242. 'param_name' => 'orderby',
  243. 'value' => array(
  244. __('Descending', 'brands-for-woocommerce') => 'desc',
  245. __('Ascending', 'brands-for-woocommerce') => 'asc',
  246. ),
  247. ),
  248. ),
  249. ) );
  250. }
  251. }
  252. add_action('vc_before_init', 'berocket_apl_vc_before_init');