A theme that I bought is adding unnecessary inline JS code that is not needed in the front page.

/* Scripts - dynamic css */
    add_action('wp_footer', 'upme_custom_scripts');
    function upme_custom_scripts(){
        require_once upme_path . 'js/upme-custom-js.php';

I would like to add to my custom.js file an override so that I dont have to edit the core file in case it gets updated. Can this be achieved? if so please show me

I was thinking about overriding the function then registering and en-queueing the js file, but i dont know how to override it.



Remove the action:

add_action('wp_footer', 'remove_upme_script', 0 );

function remove_upme_script()
    remove_action('wp_footer', 'upme_custom_scripts');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.