vc-icon-element.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. function vc_icon_element_params() {
  6. return array(
  7. 'name' => esc_html__( 'Icon', 'js_composer' ),
  8. 'base' => 'vc_icon',
  9. 'icon' => 'icon-wpb-vc_icon',
  10. 'category' => esc_html__( 'Content', 'js_composer' ),
  11. 'description' => esc_html__( 'Eye catching icons from libraries', 'js_composer' ),
  12. 'params' => array(
  13. array(
  14. 'type' => 'dropdown',
  15. 'heading' => esc_html__( 'Icon library', 'js_composer' ),
  16. 'value' => array(
  17. esc_html__( 'Font Awesome', 'js_composer' ) => 'fontawesome',
  18. esc_html__( 'Open Iconic', 'js_composer' ) => 'openiconic',
  19. esc_html__( 'Typicons', 'js_composer' ) => 'typicons',
  20. esc_html__( 'Entypo', 'js_composer' ) => 'entypo',
  21. esc_html__( 'Linecons', 'js_composer' ) => 'linecons',
  22. esc_html__( 'Mono Social', 'js_composer' ) => 'monosocial',
  23. esc_html__( 'Material', 'js_composer' ) => 'material',
  24. ),
  25. 'admin_label' => true,
  26. 'param_name' => 'type',
  27. 'description' => esc_html__( 'Select icon library.', 'js_composer' ),
  28. ),
  29. array(
  30. 'type' => 'iconpicker',
  31. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  32. 'param_name' => 'icon_fontawesome',
  33. 'value' => 'fa fa-adjust',
  34. // default value to backend editor admin_label
  35. 'settings' => array(
  36. 'emptyIcon' => false,
  37. // default true, display an "EMPTY" icon?
  38. 'iconsPerPage' => 4000,
  39. // default 100, how many icons per/page to display, we use (big number) to display all icons in single page
  40. ),
  41. 'dependency' => array(
  42. 'element' => 'type',
  43. 'value' => 'fontawesome',
  44. ),
  45. 'description' => esc_html__( 'Select icon from library.', 'js_composer' ),
  46. ),
  47. array(
  48. 'type' => 'iconpicker',
  49. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  50. 'param_name' => 'icon_openiconic',
  51. 'value' => 'vc-oi vc-oi-dial',
  52. // default value to backend editor admin_label
  53. 'settings' => array(
  54. 'emptyIcon' => false,
  55. // default true, display an "EMPTY" icon?
  56. 'type' => 'openiconic',
  57. 'iconsPerPage' => 4000,
  58. // default 100, how many icons per/page to display
  59. ),
  60. 'dependency' => array(
  61. 'element' => 'type',
  62. 'value' => 'openiconic',
  63. ),
  64. 'description' => esc_html__( 'Select icon from library.', 'js_composer' ),
  65. ),
  66. array(
  67. 'type' => 'iconpicker',
  68. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  69. 'param_name' => 'icon_typicons',
  70. 'value' => 'typcn typcn-adjust-brightness',
  71. // default value to backend editor admin_label
  72. 'settings' => array(
  73. 'emptyIcon' => false,
  74. // default true, display an "EMPTY" icon?
  75. 'type' => 'typicons',
  76. 'iconsPerPage' => 4000,
  77. // default 100, how many icons per/page to display
  78. ),
  79. 'dependency' => array(
  80. 'element' => 'type',
  81. 'value' => 'typicons',
  82. ),
  83. 'description' => esc_html__( 'Select icon from library.', 'js_composer' ),
  84. ),
  85. array(
  86. 'type' => 'iconpicker',
  87. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  88. 'param_name' => 'icon_entypo',
  89. 'value' => 'entypo-icon entypo-icon-note',
  90. // default value to backend editor admin_label
  91. 'settings' => array(
  92. 'emptyIcon' => false,
  93. // default true, display an "EMPTY" icon?
  94. 'type' => 'entypo',
  95. 'iconsPerPage' => 4000,
  96. // default 100, how many icons per/page to display
  97. ),
  98. 'dependency' => array(
  99. 'element' => 'type',
  100. 'value' => 'entypo',
  101. ),
  102. ),
  103. array(
  104. 'type' => 'iconpicker',
  105. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  106. 'param_name' => 'icon_linecons',
  107. 'value' => 'vc_li vc_li-heart',
  108. // default value to backend editor admin_label
  109. 'settings' => array(
  110. 'emptyIcon' => false,
  111. // default true, display an "EMPTY" icon?
  112. 'type' => 'linecons',
  113. 'iconsPerPage' => 4000,
  114. // default 100, how many icons per/page to display
  115. ),
  116. 'dependency' => array(
  117. 'element' => 'type',
  118. 'value' => 'linecons',
  119. ),
  120. 'description' => esc_html__( 'Select icon from library.', 'js_composer' ),
  121. ),
  122. array(
  123. 'type' => 'iconpicker',
  124. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  125. 'param_name' => 'icon_monosocial',
  126. 'value' => 'vc-mono vc-mono-fivehundredpx',
  127. // default value to backend editor admin_label
  128. 'settings' => array(
  129. 'emptyIcon' => false,
  130. // default true, display an "EMPTY" icon?
  131. 'type' => 'monosocial',
  132. 'iconsPerPage' => 4000,
  133. // default 100, how many icons per/page to display
  134. ),
  135. 'dependency' => array(
  136. 'element' => 'type',
  137. 'value' => 'monosocial',
  138. ),
  139. 'description' => esc_html__( 'Select icon from library.', 'js_composer' ),
  140. ),
  141. array(
  142. 'type' => 'iconpicker',
  143. 'heading' => esc_html__( 'Icon', 'js_composer' ),
  144. 'param_name' => 'icon_material',
  145. 'value' => 'vc-material vc-material-cake',
  146. // default value to backend editor admin_label
  147. 'settings' => array(
  148. 'emptyIcon' => false,
  149. // default true, display an "EMPTY" icon?
  150. 'type' => 'material',
  151. 'iconsPerPage' => 4000,
  152. // default 100, how many icons per/page to display
  153. ),
  154. 'dependency' => array(
  155. 'element' => 'type',
  156. 'value' => 'material',
  157. ),
  158. 'description' => esc_html__( 'Select icon from library.', 'js_composer' ),
  159. ),
  160. array(
  161. 'type' => 'dropdown',
  162. 'heading' => esc_html__( 'Icon color', 'js_composer' ),
  163. 'param_name' => 'color',
  164. 'value' => array_merge( vc_get_shared( 'colors' ), array( esc_html__( 'Custom color', 'js_composer' ) => 'custom' ) ),
  165. 'description' => esc_html__( 'Select icon color.', 'js_composer' ),
  166. 'param_holder_class' => 'vc_colored-dropdown',
  167. ),
  168. array(
  169. 'type' => 'colorpicker',
  170. 'heading' => esc_html__( 'Custom color', 'js_composer' ),
  171. 'param_name' => 'custom_color',
  172. 'description' => esc_html__( 'Select custom icon color.', 'js_composer' ),
  173. 'dependency' => array(
  174. 'element' => 'color',
  175. 'value' => 'custom',
  176. ),
  177. ),
  178. array(
  179. 'type' => 'dropdown',
  180. 'heading' => esc_html__( 'Background shape', 'js_composer' ),
  181. 'param_name' => 'background_style',
  182. 'value' => array(
  183. esc_html__( 'None', 'js_composer' ) => '',
  184. esc_html__( 'Circle', 'js_composer' ) => 'rounded',
  185. esc_html__( 'Square', 'js_composer' ) => 'boxed',
  186. esc_html__( 'Rounded', 'js_composer' ) => 'rounded-less',
  187. esc_html__( 'Outline Circle', 'js_composer' ) => 'rounded-outline',
  188. esc_html__( 'Outline Square', 'js_composer' ) => 'boxed-outline',
  189. esc_html__( 'Outline Rounded', 'js_composer' ) => 'rounded-less-outline',
  190. ),
  191. 'description' => esc_html__( 'Select background shape and style for icon.', 'js_composer' ),
  192. ),
  193. array(
  194. 'type' => 'dropdown',
  195. 'heading' => esc_html__( 'Background color', 'js_composer' ),
  196. 'param_name' => 'background_color',
  197. 'value' => array_merge( vc_get_shared( 'colors' ), array( esc_html__( 'Custom color', 'js_composer' ) => 'custom' ) ),
  198. 'std' => 'grey',
  199. 'description' => esc_html__( 'Select background color for icon.', 'js_composer' ),
  200. 'param_holder_class' => 'vc_colored-dropdown',
  201. 'dependency' => array(
  202. 'element' => 'background_style',
  203. 'not_empty' => true,
  204. ),
  205. ),
  206. array(
  207. 'type' => 'colorpicker',
  208. 'heading' => esc_html__( 'Custom background color', 'js_composer' ),
  209. 'param_name' => 'custom_background_color',
  210. 'description' => esc_html__( 'Select custom icon background color.', 'js_composer' ),
  211. 'dependency' => array(
  212. 'element' => 'background_color',
  213. 'value' => 'custom',
  214. ),
  215. ),
  216. array(
  217. 'type' => 'dropdown',
  218. 'heading' => esc_html__( 'Size', 'js_composer' ),
  219. 'param_name' => 'size',
  220. 'value' => array_merge( vc_get_shared( 'sizes' ), array( 'Extra Large' => 'xl' ) ),
  221. 'std' => 'md',
  222. 'description' => esc_html__( 'Icon size.', 'js_composer' ),
  223. ),
  224. array(
  225. 'type' => 'dropdown',
  226. 'heading' => esc_html__( 'Icon alignment', 'js_composer' ),
  227. 'param_name' => 'align',
  228. 'value' => array(
  229. esc_html__( 'Left', 'js_composer' ) => 'left',
  230. esc_html__( 'Right', 'js_composer' ) => 'right',
  231. esc_html__( 'Center', 'js_composer' ) => 'center',
  232. ),
  233. 'description' => esc_html__( 'Select icon alignment.', 'js_composer' ),
  234. ),
  235. array(
  236. 'type' => 'vc_link',
  237. 'heading' => esc_html__( 'URL (Link)', 'js_composer' ),
  238. 'param_name' => 'link',
  239. 'description' => esc_html__( 'Add link to icon.', 'js_composer' ),
  240. ),
  241. vc_map_add_css_animation(),
  242. array(
  243. 'type' => 'el_id',
  244. 'heading' => esc_html__( 'Element ID', 'js_composer' ),
  245. 'param_name' => 'el_id',
  246. 'description' => sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'js_composer' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
  247. ),
  248. array(
  249. 'type' => 'textfield',
  250. 'heading' => esc_html__( 'Extra class name', 'js_composer' ),
  251. 'param_name' => 'el_class',
  252. 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
  253. ),
  254. array(
  255. 'type' => 'css_editor',
  256. 'heading' => esc_html__( 'CSS box', 'js_composer' ),
  257. 'param_name' => 'css',
  258. 'group' => esc_html__( 'Design Options', 'js_composer' ),
  259. ),
  260. ),
  261. 'js_view' => 'VcIconElementView_Backend',
  262. );
  263. }