QTags is not defined
-
Dear Developer,
I am writing to report an issue I encountered while using your plugin “Visual Editor Custom Buttons” on my website. After upgrading my WordPress site to version 6.0, I encountered an error “QTags is not defined” caused by the following code:
QTags.addButton('tag', 'Link Tag', prompt_user); function prompt_user(e, c, ed) { prmt = prompt('Enter Tag Name'); if (prmt === null) return; rtrn = '[tag]' + prmt + '[/tag]'; this.tagStart = rtrn; QTags.TagButton.prototype.callback.call(this, e, c, ed); }
I resolved the issue by adding a window.onload event as follows:
window.addEventListener("load", function () { if (typeof QTags === "undefined") { QTags = { addButton: function () { } } } QTags.addButton('tag', 'Link Tag', prompt_user); function prompt_user(e, c, ed) { prmt = prompt('Enter Tag Name'); if (prmt === null) return; rtrn = '[tag]' + prmt + '[/tag]'; this.tagStart = rtrn; QTags.TagButton.prototype.callback.call(this, e, c, ed); } })
I would like to request an update to your plugin so that others who update their plugin won’t face the same issue in the future.
Thank you for your time and assistance in this matter.
Best regards,
Hoa Tien
- The topic ‘QTags is not defined’ is closed to new replies.