Support » Plugin: Easy Footnotes » Request: Option to disable qTip feature

  • hatisenang

    (@hatisenang)


    Hi, is there a filter to disable the qTip feature? Maybe you could add an option in the settings page? Thanks.

    • This topic was modified 1 year ago by hatisenang.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jason Yingling

    (@yingling017)

    Hi there,

    You can deregister the scripts used for qTip and it won’t display.

    function efn_deregister_scripts() {
    	wp_deregister_style( 'qtipstyles' );
    	wp_deregister_script( 'imagesloaded' );
    	wp_deregister_script( 'qtip' );
    	wp_deregister_script( 'qtipcall' );
    }
    add_action( 'wp_enqueue_scripts', 'efn_deregister_scripts' );

    Putting that in your functions.php should do the trick. I’m using deregister because currently the scripts are enqueued in the shortcode. Something I would like to rework. You won’t need any of those scripts or styles if you have qTip disabled. Though other plugins may used imagesloaded so you may or may not use that.

    Hi, thank you for that snippet worked like a charm! Only it’s result has brought me to another question which is how can I strip HTML tags from the title tag because it now show’s the raw title content including the HTML tags when you hover over the footnote link.

    Plugin Author Jason Yingling

    (@yingling017)

    Hi there,

    What type of HTML are you using in the footnotes?

    The title attribute is set on line 128 of easy-footnotes.php. You could switch out the htmlspecialchars function with something like sanitize_text_field (https://developer.wordpress.org/reference/functions/sanitize_text_field/) or strip_tags (http://php.net/manual/en/function.strip-tags.php).

    Not the best option since you’d be editing the plugin.

    Hi, thank you for the reply. I’m using regular text styling tags like <em>,<i>, <strong> & sometimes <span> for custom colors.

    I don’t want to edit plugin so I think I’ll just do it on the client side using jQuery(html).text(); for now.

    Would you consider adding an option to disable qTip and strip html tags in the future?

    Thank you.

    Plugin Author Jason Yingling

    (@yingling017)

    For sure. I’m also going to do some looking into qTip for setting the tooltip as HTML in an attribute isn’t a good practice. Thanks for bringing this to my attention.

    hatisenang

    (@hatisenang)

    Hi, I would like to suggest switching the tooltip to output as inline HTML as shown here (http://jsfiddle.net/qTip2/jd5nbj5x).

    Please let me know what you think?

    • This reply was modified 9 months ago by hatisenang.
    Plugin Author Jason Yingling

    (@yingling017)

    Thanks for sharing. I’m definitely interested in implementing that. Seems to me like it would be better practice for using HTML inside a tooltip. I also imagine it would be better for accessibility. Any other benefits you’d see from making this change?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Request: Option to disable qTip feature’ is closed to new replies.