/** * Generate html for shortcode attribute. * * Method * @since 4.4 * * @param $param * @param $value * * vc_filter: vc_single_param_edit - hook to edit any shortode param * vc_filter: vc_form_fields_render_field_{shortcode_name}_{param_name}_param_value - hook to edit shortcode param * value vc_filter: vc_form_fields_render_field_{shortcode_name}_{param_name}_param - hook to edit shortcode * param attributes vc_filter: vc_single_param_edit_holder_output - hook to edit output of this method * * @return mixed|void */ protected function renderField($param, $value) { $param['vc_single_param_edit_holder_class'] = array('wpb_el_type_' . $param['type'], 'vc_wrapper-param-type-' . $param['type'], 'vc_shortcode-param', 'vc_column'); if (!empty($param['param_holder_class'])) { $param['vc_single_param_edit_holder_class'][] = $param['param_holder_class']; } $param = apply_filters('vc_single_param_edit', $param, $value); $output = '<div class="' . implode(' ', $param['vc_single_param_edit_holder_class']) . '" data-vc-ui-element="panel-shortcode-param" data-vc-shortcode-param-name="' . esc_attr($param['param_name']) . '" data-param_type="' . esc_attr($param['type']) . '" data-param_settings="' . esc_attr(json_encode($param)) . '">'; $output .= isset($param['heading']) ? '<div class="wpb_element_label">' . $param['heading'] . '</div>' : ''; $output .= '<div class="edit_form_line">'; $value = apply_filters('vc_form_fields_render_field_' . $this->setting('base') . '_' . $param['param_name'] . '_param_value', $value, $param, $this->settings, $this->atts); $param = apply_filters('vc_form_fields_render_field_' . $this->setting('base') . '_' . $param['param_name'] . '_param', $param, $value, $this->settings, $this->atts); $output = apply_filters('vc_edit_form_fields_render_field_' . $param['type'] . '_before', $output); $output .= vc_do_shortcode_param_settings_field($param['type'], $param, $value, $this->setting('base')); $output_after = ''; if (isset($param['description'])) { $output_after .= '<span class="vc_description vc_clearfix">' . $param['description'] . '</span>'; } $output_after .= '</div></div>'; $output .= apply_filters('vc_edit_form_fields_render_field_' . $param['type'] . '_after', $output_after); return apply_filters('vc_single_param_edit_holder_output', $output, $param, $value, $this->settings, $this->atts); }
/** * Call hook for attribute. * * @param $name - attribute name * @param $param_settings - attribute settings from shortcode * @param $param_value - attribute value * @param $tag - attribute tag * * @since 4.2 * @deprecated due to without prefix function 4.4 * @return mixed|string - returns html which will be render in hook */ function do_shortcode_param_settings_field($name, $param_settings, $param_value, $tag) { _deprecated_function('do_shortcode_param_settings_field', '4.4', 'vc_do_shortcode_param_settings_field'); return vc_do_shortcode_param_settings_field($name, $param_settings, $param_value, $tag); }
/** * Call hook for attribute. * * @param $name - attribute name * @param $param_settings - attribute settings from shortcode * @param $param_value - attribute value * @param $tag - attribute tag * * @since 4.2 * @deprecated due to without prefix function 4.4 * @return mixed|string - returns html which will be render in hook */ function do_shortcode_param_settings_field($name, $param_settings, $param_value, $tag) { // _deprecated_function( 'do_shortcode_param_settings_field', '4.4 (will be removed in 4.10)', 'vc_do_shortcode_param_settings_field' ); return vc_do_shortcode_param_settings_field($name, $param_settings, $param_value, $tag); }
/** * Call hook for attribute. * * @param $name - attribute name * @param $param_settings - attribute settings from shortcode * @param $param_value - attribute value * @param $tag - attribute tag * * @since 4.2 * @deprecated due to without prefix function * @return mixed|string - returns html which will be render in hook */ function do_shortcode_param_settings_field($name, $param_settings, $param_value, $tag) { return vc_do_shortcode_param_settings_field($name, $param_settings, $param_value, $tag); }
/** * Generate html for shortcode attribute. * * Method * @since 4.4 * * @param $param * @param $value * * vc_filter: vc_single_param_edit - hook to edit any shortode param * vc_filter: vc_form_fields_render_field_{shortcode_name}_{param_name}_param_value - hook to edit shortcode param value * vc_filter: vc_form_fields_render_field_{shortcode_name}_{param_name}_param - hook to edit shortcode param attributes * vc_filter: vc_single_param_edit_holder_output - hook to edit output of this method * @return mixed|void */ protected function renderField($param, $value) { $param['vc_single_param_edit_holder_class'] = array('wpb_el_type_' . $param['type'], 'vc_shortcode-param'); if (!empty($param['param_holder_class'])) { $param['vc_single_param_edit_holder_class'][] = $param['param_holder_class']; } $param = apply_filters('vc_single_param_edit', $param, $value); $output = '<div class="' . implode(' ', $param['vc_single_param_edit_holder_class']) . '" data-param_name="' . $param['param_name'] . '" data-param_type="' . $param['type'] . '">'; $output .= isset($param['heading']) ? '<div class="wpb_element_label">' . __($param['heading'], "js_composer") . '</div>' : ''; $output .= '<div class="edit_form_line">'; $value = apply_filters('vc_form_fields_render_field_' . $this->setting('base') . '_' . $param['param_name'] . '_param_value', $value, $param, $this->settings, $this->atts); $param = apply_filters('vc_form_fields_render_field_' . $this->setting('base') . '_' . $param['param_name'] . '_param', $param, $value, $this->settings, $this->atts); $output .= vc_do_shortcode_param_settings_field($param['type'], $param, $value, $this->setting('base')); if (isset($param['description'])) { $output .= '<span class="vc_description vc_clearfix">' . __($param['description'], "js_composer") . '</span>'; } $output .= '</div>'; $output .= '</div>'; return apply_filters('vc_single_param_edit_holder_output', $output, $param, $value, $this->settings, $this->atts); }