options.php 987 B

123456789101112131415161718192021222324
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. /**
  6. * @param $settings
  7. * @param $value
  8. *
  9. * @return string
  10. * @since 4.2
  11. */
  12. function vc_options_form_field( $settings, $value ) {
  13. return sprintf( '<div class="vc_options"><input name="%s" class="wpb_vc_param_value %s_field" type="hidden" value="%s"/><a href="#" class="button vc_options-edit %s_button">%s</a></div><div class="vc_options-fields" data-settings="%s"><a href="#" class="button vc_close-button">%s</a></div>', esc_attr( $settings['param_name'] ), esc_attr( $settings['param_name'] . ' ' . $settings['type'] ), $value, esc_attr( $settings['param_name'] ), esc_html__( 'Manage options', 'js_composer' ), htmlspecialchars( wp_json_encode( $settings['options'] ) ), esc_html__( 'Close', 'js_composer' ) );
  14. }
  15. /**
  16. * @since 4.2
  17. */
  18. function vc_options_include_templates() {
  19. require_once vc_path_dir( 'TEMPLATES_DIR', 'params/options/templates.html' );
  20. }
  21. add_action( 'admin_footer', 'vc_options_include_templates' );