Best Answer eric , 30 May 2014 - 12:43 AM
Hi ddover,
Thanks for the good question. As Brandon indicated, TubePress doesn't offer out-of-the-box support for selective page loading in WordPress environments. While it's certainly possible to selectively load plugins, we're not aware of any non-programmatic way to do this easily. That said, it seems like you are pretty comfortable with PHP and the WordPress API, so here are some tips:
In TubePress 3.1.x and below, here is where TubePress enqueues its script and CSS file. You can ignore the $wordPressFunctionWrapper-> noise as that is simply there for unit testing. e.g.
$wordPressFunctionWrapper->wp_enqueue_script()
is the same as
wp_enqueue_script()
So you could easily add some logic at line 56 to only run on certain pages. e.g.
... if (!is_page('my videos')) { return; } $wordPressFunctionWrapper->wp_register_script('tubepress', $jsUrl); $wordPressFunctionWrapper->wp_register_style('tubepress', $cssUrl); ...
Does that answer your question?
Go to the full post