admin管理员组文章数量:1124688
I have a wordpress plugin for a third party site I run. I runs in conjunction with the standard text editor module used in pagebuilders (Beaver Builder, Divi, Elementor, etc), but for some reason, it's stopped working since WP 6.4.x
The the plugin takes options, and then uses a simple JS function to build and insert a shortcode.
For reasons unknown, it has begun throwing a "Reference Error: Can't find variable : BuildButtonSC
The (abbreviated) code for the HTML and JS is:
<div id="tripSelector">
<h2>Insert Button</h2>
<div style="">
<select class="all_trips" name="all_trips">
<option value="">Select a Trip</option>
<option value="4">Bob's Bimini Boat Tours</option>
<option value="18">Bob's Second Tour</option>
</select>
</div>
[snipped additional fields]
<div>
<input type="button" class="button-primary" value="Add Button for This Trip" onclick="BuildButtonSC(); return false;">
<input type="button" class="button" value="Cancel" style="color:#bbb;" href="#" onclick="tb_remove(); return false;">
</div>
</div>
<script>
jQuery(function($) {
$('#TB_window .all_trips').change(function(){
var sel=$("#TB_window .all_trips").val();
});
});
function BuildButtonSC(){
var thistrip = jQuery("#TB_window .all_trips").val();
var button_class = jQuery("#TB_window .rezbs_btn").val();
var button_label = jQuery("#TB_window .btn_label").val();
if( button_class == '' ){ button_class = 'rezbs_button'; }
if( button_label == '' ){ button_label = 'Book Now!'; }
var theShortcode = '[rezbs_button id="' + thistrip + '" label="' + button_label + '" class="' + button_class + '"]';
window.send_to_editor(theShortcode);
tb_remove();
}
</script>
At a loss as to what is wrong with this one.
Can anyone spot a possible issue?
本文标签: javascriptWordpress PluginElementor and the ReferenceError nightmare
版权声明:本文标题:javascript - Wordpress Plugin, Elementor and the ReferenceError nightmare 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736643406a1946050.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论