FitVids for WordPress
[resolved] Object doesn't support property or method 'fitVids' (3 posts)

  1. helgatheviking
    Posted 3 years ago #

    i noticed this javascript error when i tried to set a custom CSS selector on the fitvids options page.

    The following prints in the footer:

    jQuery(document).ready(function() {

    which would be right except that it prints before the fitvids.js is loaded.

    // add fitvids
        	wp_register_script( 'fitvids', plugins_url('/jquery.fitvids.js', __FILE__), array('jquery'), '1.0', true);
        	wp_enqueue_script( 'fitvids');
        	add_action('wp_footer', array($this, 'add_fitthem'));

    JS files that are enqueued in the footer (that last parameter = true) are actually added to wp_footer via the wp_print_footer_scripts hook which has a priority of 20.

    since you aren't declaring a priority on

    add_action('wp_footer', array($this, 'add_fitthem'));

    it is 10 by default which comes before the script is loaded, hence my error.

    this can be corrected in 1 of 2 ways. by changing to either

    add_action('wp_print_footer_scripts', array($this, 'add_fitthem'));


    add_action('wp_footer', array($this, 'add_fitthem'), 30);


  2. Kevin Dees
    Plugin Author

    Posted 3 years ago #

    I think have fixed this issue in the latest version 2.1

  3. helgatheviking
    Posted 3 years ago #

    great! thanks for your work!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • FitVids for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic