shortcode-vc-single-image.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. return array(
  6. 'name' => esc_html__( 'Single Image', 'js_composer' ),
  7. 'base' => 'vc_single_image',
  8. 'icon' => 'icon-wpb-single-image',
  9. 'category' => esc_html__( 'Content', 'js_composer' ),
  10. 'description' => esc_html__( 'Simple image with CSS animation', 'js_composer' ),
  11. 'params' => array(
  12. array(
  13. 'type' => 'textfield',
  14. 'heading' => esc_html__( 'Widget title', 'js_composer' ),
  15. 'param_name' => 'title',
  16. 'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
  17. ),
  18. array(
  19. 'type' => 'dropdown',
  20. 'heading' => esc_html__( 'Image source', 'js_composer' ),
  21. 'param_name' => 'source',
  22. 'value' => array(
  23. esc_html__( 'Media library', 'js_composer' ) => 'media_library',
  24. esc_html__( 'External link', 'js_composer' ) => 'external_link',
  25. esc_html__( 'Featured Image', 'js_composer' ) => 'featured_image',
  26. ),
  27. 'std' => 'media_library',
  28. 'description' => esc_html__( 'Select image source.', 'js_composer' ),
  29. ),
  30. array(
  31. 'type' => 'attach_image',
  32. 'heading' => esc_html__( 'Image', 'js_composer' ),
  33. 'param_name' => 'image',
  34. 'value' => '',
  35. 'description' => esc_html__( 'Select image from media library.', 'js_composer' ),
  36. 'dependency' => array(
  37. 'element' => 'source',
  38. 'value' => 'media_library',
  39. ),
  40. 'admin_label' => true,
  41. ),
  42. array(
  43. 'type' => 'textfield',
  44. 'heading' => esc_html__( 'External link', 'js_composer' ),
  45. 'param_name' => 'custom_src',
  46. 'description' => esc_html__( 'Select external link.', 'js_composer' ),
  47. 'dependency' => array(
  48. 'element' => 'source',
  49. 'value' => 'external_link',
  50. ),
  51. 'admin_label' => true,
  52. ),
  53. array(
  54. 'type' => 'textfield',
  55. 'heading' => esc_html__( 'Image size', 'js_composer' ),
  56. 'param_name' => 'img_size',
  57. 'value' => 'thumbnail',
  58. 'description' => esc_html__( 'Enter image size (Example: "thumbnail", "medium", "large", "full" or other sizes defined by theme). Alternatively enter size in pixels (Example: 200x100 (Width x Height)).', 'js_composer' ),
  59. 'dependency' => array(
  60. 'element' => 'source',
  61. 'value' => array(
  62. 'media_library',
  63. 'featured_image',
  64. ),
  65. ),
  66. ),
  67. array(
  68. 'type' => 'textfield',
  69. 'heading' => esc_html__( 'Image size', 'js_composer' ),
  70. 'param_name' => 'external_img_size',
  71. 'value' => '',
  72. 'description' => esc_html__( 'Enter image size in pixels. Example: 200x100 (Width x Height).', 'js_composer' ),
  73. 'dependency' => array(
  74. 'element' => 'source',
  75. 'value' => 'external_link',
  76. ),
  77. ),
  78. array(
  79. 'type' => 'textfield',
  80. 'heading' => esc_html__( 'Caption', 'js_composer' ),
  81. 'param_name' => 'caption',
  82. 'description' => esc_html__( 'Enter text for image caption.', 'js_composer' ),
  83. 'dependency' => array(
  84. 'element' => 'source',
  85. 'value' => 'external_link',
  86. ),
  87. ),
  88. array(
  89. 'type' => 'checkbox',
  90. 'heading' => esc_html__( 'Add caption?', 'js_composer' ),
  91. 'param_name' => 'add_caption',
  92. 'description' => esc_html__( 'Add image caption.', 'js_composer' ),
  93. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  94. 'dependency' => array(
  95. 'element' => 'source',
  96. 'value' => array(
  97. 'media_library',
  98. 'featured_image',
  99. ),
  100. ),
  101. ),
  102. array(
  103. 'type' => 'dropdown',
  104. 'heading' => esc_html__( 'Image alignment', 'js_composer' ),
  105. 'param_name' => 'alignment',
  106. 'value' => array(
  107. esc_html__( 'Left', 'js_composer' ) => 'left',
  108. esc_html__( 'Right', 'js_composer' ) => 'right',
  109. esc_html__( 'Center', 'js_composer' ) => 'center',
  110. ),
  111. 'description' => esc_html__( 'Select image alignment.', 'js_composer' ),
  112. ),
  113. array(
  114. 'type' => 'dropdown',
  115. 'heading' => esc_html__( 'Image style', 'js_composer' ),
  116. 'param_name' => 'style',
  117. 'value' => vc_get_shared( 'single image styles' ),
  118. 'description' => esc_html__( 'Select image display style.', 'js_composer' ),
  119. 'dependency' => array(
  120. 'element' => 'source',
  121. 'value' => array(
  122. 'media_library',
  123. 'featured_image',
  124. ),
  125. ),
  126. ),
  127. array(
  128. 'type' => 'dropdown',
  129. 'heading' => esc_html__( 'Image style', 'js_composer' ),
  130. 'param_name' => 'external_style',
  131. 'value' => vc_get_shared( 'single image external styles' ),
  132. 'description' => esc_html__( 'Select image display style.', 'js_composer' ),
  133. 'dependency' => array(
  134. 'element' => 'source',
  135. 'value' => 'external_link',
  136. ),
  137. ),
  138. array(
  139. 'type' => 'dropdown',
  140. 'heading' => esc_html__( 'Border color', 'js_composer' ),
  141. 'param_name' => 'border_color',
  142. 'value' => vc_get_shared( 'colors' ),
  143. 'std' => 'grey',
  144. 'dependency' => array(
  145. 'element' => 'style',
  146. 'value' => array(
  147. 'vc_box_border',
  148. 'vc_box_border_circle',
  149. 'vc_box_outline',
  150. 'vc_box_outline_circle',
  151. 'vc_box_border_circle_2',
  152. 'vc_box_outline_circle_2',
  153. ),
  154. ),
  155. 'description' => esc_html__( 'Border color.', 'js_composer' ),
  156. 'param_holder_class' => 'vc_colored-dropdown',
  157. ),
  158. array(
  159. 'type' => 'dropdown',
  160. 'heading' => esc_html__( 'Border color', 'js_composer' ),
  161. 'param_name' => 'external_border_color',
  162. 'value' => vc_get_shared( 'colors' ),
  163. 'std' => 'grey',
  164. 'dependency' => array(
  165. 'element' => 'external_style',
  166. 'value' => array(
  167. 'vc_box_border',
  168. 'vc_box_border_circle',
  169. 'vc_box_outline',
  170. 'vc_box_outline_circle',
  171. ),
  172. ),
  173. 'description' => esc_html__( 'Border color.', 'js_composer' ),
  174. 'param_holder_class' => 'vc_colored-dropdown',
  175. ),
  176. array(
  177. 'type' => 'dropdown',
  178. 'heading' => esc_html__( 'On click action', 'js_composer' ),
  179. 'param_name' => 'onclick',
  180. 'value' => array(
  181. esc_html__( 'None', 'js_composer' ) => '',
  182. esc_html__( 'Link to large image', 'js_composer' ) => 'img_link_large',
  183. esc_html__( 'Open prettyPhoto', 'js_composer' ) => 'link_image',
  184. esc_html__( 'Open custom link', 'js_composer' ) => 'custom_link',
  185. esc_html__( 'Zoom', 'js_composer' ) => 'zoom',
  186. ),
  187. 'description' => esc_html__( 'Select action for click action.', 'js_composer' ),
  188. 'std' => '',
  189. ),
  190. array(
  191. 'type' => 'href',
  192. 'heading' => esc_html__( 'Image link', 'js_composer' ),
  193. 'param_name' => 'link',
  194. 'description' => esc_html__( 'Enter URL if you want this image to have a link (Note: parameters like "mailto:" are also accepted).', 'js_composer' ),
  195. 'dependency' => array(
  196. 'element' => 'onclick',
  197. 'value' => 'custom_link',
  198. ),
  199. ),
  200. array(
  201. 'type' => 'dropdown',
  202. 'heading' => esc_html__( 'Link Target', 'js_composer' ),
  203. 'param_name' => 'img_link_target',
  204. 'value' => vc_target_param_list(),
  205. 'dependency' => array(
  206. 'element' => 'onclick',
  207. 'value' => array(
  208. 'custom_link',
  209. 'img_link_large',
  210. ),
  211. ),
  212. ),
  213. vc_map_add_css_animation(),
  214. array(
  215. 'type' => 'el_id',
  216. 'heading' => esc_html__( 'Element ID', 'js_composer' ),
  217. 'param_name' => 'el_id',
  218. '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>' ),
  219. ),
  220. array(
  221. 'type' => 'textfield',
  222. 'heading' => esc_html__( 'Extra class name', 'js_composer' ),
  223. 'param_name' => 'el_class',
  224. 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
  225. ),
  226. array(
  227. 'type' => 'css_editor',
  228. 'heading' => esc_html__( 'CSS box', 'js_composer' ),
  229. 'param_name' => 'css',
  230. 'group' => esc_html__( 'Design Options', 'js_composer' ),
  231. ),
  232. // backward compatibility. since 4.6
  233. array(
  234. 'type' => 'hidden',
  235. 'param_name' => 'img_link_large',
  236. ),
  237. ),
  238. );