WordPress.org

Support

Support » Plugins and Hacks » Hacks » Change script location in PushUpTheWeb plugin

Change script location in PushUpTheWeb plugin

  • I need to change the pushup.js that this plugin loads to use my customized version located in my child theme’s directory, e.g.,

    wp-content/themes/my_child_theme/javascripts/pushup.js

    I’ve modified the plugin’s supplied .js for now, but obviously that will be overwritten whenever the plugin gets updated.

    I read elsewhere that add_filter() can be used for this sort of thing, but I can’t make heads nor tails of the documentation. Can someone post an example of how this might be done (preferably w/ comment lines to help less experienced coders?)

    Here’s the relevant section of pushuptheweb-wordpress.php:

    function putw_wp_head() {
    	global $putwpath, $post;
    	echo "<link rel='stylesheet' type='text/css' href='$putwpath/pushuptheweb/css/pushup.css' />\n";
    	echo "<script type='text/javascript' src='$putwpath/pushuptheweb/js/pushup.js'></script>\n";
    }
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    @bcworkz

    You can only use add_filter() when a developer intends you to do so by his using of apply_filters() in his code. Since the pushup developer did not do this, you cannot use add_filter() in this situation.

Viewing 1 replies (of 1 total)
  • The topic ‘Change script location in PushUpTheWeb plugin’ is closed to new replies.
Skip to toolbar