Support » Plugin: TubePress » Load TubePress Scripts Conditionally

  • Ryan Cowles



    First, thank you for sharing your plugin with the public! I appreciate the time that you’ve put into it. I did just want to ask a quick question though.

    Is there a way I can load the necessary JS/CSS when needed? I can’t seem to find any wp_enqueue_script calls within the plugin files, otherwise I would just add conditional statements to them.

    It seems that the plugin is a little heavy, so if I can limit the files to load only when needed, that would be ideal.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eric



    This is on the roadmap to be fixed in the next release (see this ticket).

    In the meantime, you could add some conditional logic here to have TubePress load on a specific page.

    Ryan Cowles


    Hi Eric,

    Thanks for the reply! I tried modifying line 138 with the following:
    if (is_admin() || !is_page(10) || __FILE__ === 'wp-login.php')
    where 10 = Page that TubePress is on. However, this results in TubePress not being loaded on any pages, including page with ID 10.

    I’ll keep trying, but if you can see anything that may be causing the conditional to fail then let me know.

    Thanks again for the plugin, and taking the time to provide support.

    Ryan Cowles


    Has anyone been able to figure this out?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Load TubePress Scripts Conditionally’ is closed to new replies.