Title: QTags.addButton
Last modified: February 1, 2021

---

# QTags.addButton

 *  Resolved [DPartridge](https://wordpress.org/support/users/dpartridge/)
 * (@dpartridge)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/qtags-addbutton/)
 * The QTags.addButton is throwing an uncaught reference error of “QTags is not 
   defined” in my Admin area. Is this a known issue?
 * Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fqtags-addbutton%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [pewgeuges](https://wordpress.org/support/users/pewgeuges/)
 * (@pewgeuges)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/qtags-addbutton/#post-13989602)
 * [@dpartridge](https://wordpress.org/support/users/dpartridge/)
 * Thank you for reporting this bug. After scrambling to investigate it—the presence
   of the “footnotes” button seems to be limited to the Classic Editor, and the 
   button doesn’t seem to work there although it has recently been [reported](https://wordpress.org/support/topic/footnotes-use-in-popup-maker/)
   to do so—I can only tell that the same or a similar bug must have been known 
   around 2017 because back then a fix was implemented in templates/dashboard/editor-
   button.php:
 *     ```
        * Adds a check to ensure the quicktags script is available
        * preventing undefined error if no quicktags script
       ```
   
 * It doesn’t seem to be effective though, given this template file doesn’t even
   seem to be loaded, and the original HTML version templates/dashboard/editor-button.
   html, that probably causes the error message you are seeing, remained unfixed.
 * However I don’t get the error message despite having debug mode and checking 
   also the browser console, on a page with the Classic Editor.
 * I wonder also how quicktags could be missing given there is support for it in
   wp-admin/js, and the other buttons are working fine.
 * [Despite my label](https://meta.trac.wordpress.org/ticket/5553) I’m not the plugin’s
   author, only functionally a maintenance programmer and basically a user coming
   up with a bunch of bug fixes 3 months ago. The only thing I can figure out at
   this point is to port the fix to JavaScript and add the check right in the original
   template’s inline script. But this is only for the text editor, not the visual
   editor:
 *     ```
       /**
        * adds a new button to the plain text editor
        *
        * @edit 2.5.4d1  try to fix uncaught reference error of “QTags is not defined”
        *
        * @reporter @dpartridge
        * @bugreport https://wordpress.org/support/topic/qtags-addbutton/
        */
       if ( QTags ) {
           QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnotes', MCI_Footnotes_text_editor_callback );
       }
       ```
   
 * If you would like to test whether this works out as expected, please download
   and install the current development version from [https://downloads.wordpress.org/plugin/footnotes.zip](https://downloads.wordpress.org/plugin/footnotes.zip)
 * Also I’d love to learn how you managed to get the error message to show up, and
   where it displays in your Admin.
 * Thank you.
    -  This reply was modified 5 years, 2 months ago by [pewgeuges](https://wordpress.org/support/users/pewgeuges/).
 *  Plugin Contributor [pewgeuges](https://wordpress.org/support/users/pewgeuges/)
 * (@pewgeuges)
 * [5 years ago](https://wordpress.org/support/topic/qtags-addbutton/#post-14267683)
 * [@dpartridge](https://wordpress.org/support/users/dpartridge/),
 * Sorry for not testing sooner in WordPress 5.6, where the error occurs; no error
   in WP 5.5 and WP 5.7. In WP 5.6.2, clicking the `footnote` button in the Classic Editor
   Text mode doesn’t work, and gives an AJAX 404 error. Clicking the `fn` button
   in Visual mode does not ouput any error, it works correctly.
 * Doing the same in the preceding WP version (5.5.3) or in the following one (5.7)
   works in both modes and doesn’t output anything in the console.
 * Also in WP 5.6.2, the error occurs regardless whether in templates/dashboard/
   editor-button.html the if statement is added or not:
 *     ```
       if ( QTags ) {
       	QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnote', MCI_Footnotes_text_editor_callback );
       }
       ```
   
 * For Footnotes v1.6.5, a desperate attempt was made to solve the same problem 
   so the issue pre-existed in then-WordPress, until WordPress fixed it more or 
   less successfully, then definitely(?).
 * As in current WP 5.7 this problem seems solved I’ll mark this topic as resolved;
   if you continue to encounter issues, please feel free to use it or open a new
   one and we’ll strive to get a solution.
 * Thanks for reporting and helping fix the numerous bugs (now a few less than previously)
   in Footnotes.
 * Best regards.
    -  This reply was modified 5 years ago by [pewgeuges](https://wordpress.org/support/users/pewgeuges/).
    -  This reply was modified 5 years ago by [pewgeuges](https://wordpress.org/support/users/pewgeuges/).
 *  [JCV](https://wordpress.org/support/users/psykonevro/)
 * (@psykonevro)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/qtags-addbutton/#post-14728318)
 * [@pewgeuges](https://wordpress.org/support/users/pewgeuges/)
 * I reopen this bug since it appears again since wordpress 5.8
 * I see the message in chrome dev console when browsing administration panels.
 * You may try the following function, as advised by WordPress:
 *     ```
       	if ( wp_script_is('quicktags' ) ) {
       		QTags.addButton( 'MCI_Footnotes_QuickTag_button', 'footnote', MCI_Footnotes_text_editor_callback );
       	}
       ```
   
 * Thanks!
    -  This reply was modified 4 years, 8 months ago by [JCV](https://wordpress.org/support/users/psykonevro/).
      Reason: added fix
 *  Plugin Contributor [pewgeuges](https://wordpress.org/support/users/pewgeuges/)
 * (@pewgeuges)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/qtags-addbutton/#post-14728918)
 * [@psykonevro](https://wordpress.org/support/users/psykonevro/),
 * Many thanks for this fix! I’m sure that the plugin authors will add it in the
   code. As you mentioned in [https://wordpress.org/support/topic/qtags-addbutton-take-two/](https://wordpress.org/support/topic/qtags-addbutton-take-two/),
   this topic is on the brink of closure, so we’ll follow up in take two.
 * Best regards.
    -  This reply was modified 4 years, 8 months ago by [pewgeuges](https://wordpress.org/support/users/pewgeuges/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘QTags.addButton’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/footnotes_9d9c99.svg)
 * [footnotes](https://wordpress.org/plugins/footnotes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/footnotes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/footnotes/)
 * [Active Topics](https://wordpress.org/support/plugin/footnotes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/footnotes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/footnotes/reviews/)

## Tags

 * [qtags](https://wordpress.org/support/topic-tag/qtags/)

 * 4 replies
 * 3 participants
 * Last reply from: [pewgeuges](https://wordpress.org/support/users/pewgeuges/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/qtags-addbutton/#post-14728918)
 * Status: resolved