Load TubePress Scripts Conditionally (4 posts)

  1. Ryan Cowles
    Posted 4 years ago #


    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.


  2. Eric
    Plugin Author

    Posted 4 years ago #


    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.

  3. Ryan Cowles
    Posted 4 years ago #

    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.

  4. Ryan Cowles
    Posted 4 years ago #

    Has anyone been able to figure this out?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • TubePress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic