helpers_deprecated.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. /**
  6. * Helper function to register new shortcode attribute hook.
  7. *
  8. * @param $name - attribute name
  9. * @param $form_field_callback - hook, will be called when settings form is shown and attribute added to shortcode
  10. * param list
  11. * @param $script_url - javascript file url which will be attached at the end of settings form.
  12. *
  13. * @return bool
  14. * @deprecated due to without prefix name 4.4
  15. * @since 4.2
  16. */
  17. function add_shortcode_param( $name, $form_field_callback, $script_url = null ) {
  18. _deprecated_function( 'add_shortcode_param', '4.4 (will be removed in 6.0)', 'vc_add_shortcode_param' );
  19. return vc_add_shortcode_param( $name, $form_field_callback, $script_url );
  20. }
  21. /**
  22. * @return mixed|string
  23. * @since 4.2
  24. * @deprecated 4.2
  25. */
  26. function get_row_css_class() {
  27. _deprecated_function( 'get_row_css_class', '4.2 (will be removed in 6.0)' );
  28. $custom = vc_settings()->get( 'row_css_class' );
  29. return ! empty( $custom ) ? $custom : 'vc_row-fluid';
  30. }
  31. /**
  32. * @return string
  33. * @deprecated 5.2
  34. */
  35. function vc_generate_dependencies_attributes() {
  36. _deprecated_function( 'vc_generate_dependencies_attributes', '5.1', '' );
  37. return '';
  38. }
  39. /**
  40. * Extract width/height from string
  41. *
  42. * @param string $dimensions WxH
  43. * @return mixed array(width, height) or false
  44. * @since 4.7
  45. *
  46. * @deprecated since 5.8
  47. */
  48. function vcExtractDimensions( $dimensions ) {
  49. _deprecated_function( 'vcExtractDimensions', '5.8', 'vc_extract_dimensions' );
  50. return vc_extract_dimensions( $dimensions );
  51. }
  52. /**
  53. * @param array $images IDs or srcs of images
  54. * @return string
  55. * @since 4.2
  56. * @deprecated since 2019, 5.8
  57. */
  58. function fieldAttachedImages( $images = array() ) {
  59. _deprecated_function( 'fieldAttachedImages', '5.8', 'vc_field_attached_images' );
  60. return vc_field_attached_images( $images );
  61. }
  62. /**
  63. * @param string $asset
  64. *
  65. * @return array|string
  66. * @deprecated
  67. */
  68. function getVcShared( $asset = '' ) {
  69. return vc_get_shared( $asset );
  70. }
  71. /**
  72. * Return a action param for ajax
  73. * @return bool
  74. * @since 4.8
  75. * @deprecated 6.1
  76. */
  77. function vc_wp_action() {
  78. _deprecated_function( 'vc_wp_action', '6.1', 'vc_request_param' );
  79. return vc_request_param( 'action' );
  80. }