Providing fallback function and allow override by plugin

The after_setup_theme hook is actually an action hook not a filter hook. Nonetheless that should not be needed. Give this a try: if( ! function_exists( ‘get_field’ ) ) { function get_field( $key, $post_id = false, $format_value = true ) { if( false === $post_id ) { global $post; $post_id = $post->ID; } return get_post_meta( $post_id, … Read more

WordPress reading old version of functions.php, breaks site

The issue was indeed server side caching. Bluehost was very helpful in providing a way to fix it via FTP. Do the following: In the /wp-content/mu-plugins directory, there is a file called endurance-browser-cache.php. By renaming the file, for example to endurance-browser-cache.old, visiting the site, and returning the name to endurance-browser-cache.php, WordPress will have had to … Read more

Is it possible to override only a part of another plugin’s / theme’s js (asset) file?

Unfortunately no, you can dequeue the file as the other questions answer suggests and enqueue your own version, otherwise you’d need to load it and then try to modify the loaded code at runtime, which is almost always not feasible. Monkeypatching might be a solution, assuming your code runs before theirs does, but is loaded … Read more