php - Using new Js and Css scripts in Wordpress -
i developing wordpress plugin. want plugin work on many wordpress installations possible.
in order use various js , css scripts in plugin. want make use of wp_register_script( $handle, $src, $deps, $ver, $in_footer );
my doubt that, eg. have use plupload functionality. on referring documentation. http://codex.wordpress.org/function_reference/wp_enqueue_script#link_scripts_only_on_a_plugin_administration_screen. found plupload script included under default script.
how determine, wordpress installation has script default. wordpress version. not have manually add scripts part of plugin.
thanks in advance
browsing wordpress versions, see /wp-includes/js/plupload/
introduced on version 3.3. can creat check versions lower 3.3 in register_activation_hook
(and display admin_notice
or abort installation). or enqueue alternative script if version lower.
from here, function check current version
if ( ! function_exists( 'is_version' ) ) { function is_version( $version = '3.3' ) { global $wp_version; if ( version_compare( $wp_version, $version, '>=' ) ) { return false; } return true; } }
and relevant wpse post: code determine wp version check
Comments
Post a Comment