WordPress.org

Ready to get started?Download WordPress

Forums

TubePress
Load TubePress Scripts Conditionally (4 posts)

  1. Ryan Cowles
    Member
    Posted 2 years ago #

    Hello,

    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.

    http://wordpress.org/extend/plugins/tubepress/

  2. Eric
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    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
    Member
    Posted 2 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
    Member
    Posted 2 years ago #

    Has anyone been able to figure this out?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags