Visual Composer – buttons dont save data, undefined

 In Wordpress

Recently we had a client who had an issue with visual composer and buttons not saving urls and returning and undefined “Error”

To correct this problem you have change the variable names of the tags

File URL fix location:

Find the file assets/js/params/composer-atts.js or for older versions it can be in assets/js/params/all.js

if (_.isString(value_object.url)) $(‘#url-field’).val(value_object.url);
if (_.isString(value_object.title)) $(‘#link-title-field’).val(value_object.title);
$(‘#link-target-checkbox’).prop(‘checked’, !_.isEmpty(value_object.target));

$vc_link_submit.unbind(‘click.vcLink’).bind(‘click.vcLink’, function (e) {
e.preventDefault();
e.stopImmediatePropagation();
var options = {},
string = ”;
options.url = $(‘#url-field’).val();
options.title = $(‘#link-title-field’).val();
var $checkbox = $(‘#link-target-checkbox’);

And replace with:

if (_.isString(value_object.url)) $(‘#wp-link-url’).val(value_object.url);
if (_.isString(value_object.title)) $(‘#wp-link-text’).val(value_object.title);
$(‘#wp-link-target’).prop(‘checked’, !_.isEmpty(value_object.target));

$vc_link_submit.unbind(‘click.vcLink’).bind(‘click.vcLink’, function (e) {
e.preventDefault();
e.stopImmediatePropagation();
var options = {},
string = ”;
options.url = $(‘#wp-link-url’).val();
options.title = $(‘#wp-link-text’).val();
var $checkbox = $(‘#wp-link-target’);

Recommended Posts

Start typing and press Enter to search