I want to echo out the version of a particular wp_register_script or wp_enqueue_script on the frontend.
Like Superfish JS registered via:
wp_register_script( 'superfish', GENESIS_JS_URL . "/menu/superfish{$this->suffix}.js", array( 'jquery', 'hoverIntent' ), '1.7.10', true );
wp_register_script( 'superfish-args', apply_filters( 'genesis_superfish_args_url', GENESIS_JS_URL . "/menu/superfish.args{$this->suffix}.js" ), array( 'superfish' ), PARENT_THEME_VERSION, true );
And, I want to get the version of these JS reflected on frontend via:
add_filter('the_content','addToEndOfPost');
function addToEndOfPost($content) {
if (is_single()){
return $content . '<p>Version of Superfish JS:</p>';
}
return $content;}
Even if I could get the separate script as a variable, I might be able to use a delimiter to separate out the version and id of these scripts. I'm trying WordPress development for the first time, so please help.
source https://stackoverflow.com/questions/69366486/how-do-i-echo-out-particular-wp-register-script-or-wp-enqueue-script-version-and
Comments
Post a Comment