0
votes

I'm trying to transfer my clients new site to their domain. While uploading the theme I accidentally went to another page while it was updating plug-in translations, now I get this error when activating the theme:

Fatal error: Call to undefined function wp_add_inline_script() in /home/pxxr228380/domains/braincaps.nl/public_html/wp-content/themes/mrbara/inc/frontend/header.php on line 49

Reuploading the theme doesn't fix it and the original site still works fine. How do I fix this? The line in question is: wp_add_inline_script( 'mrbara', mrbara_footer_scripts() );

Note: I'm installing it on an existing Wordpress installation with installed plug-ins, could it be a plug-in causing this?

1

1 Answers

1
votes

The function wp_add_inline_script() should normally be defined by the time the theme's code starts running. Is the site running an older version of WordPress? The undefined function was introduced in WordPress 4.5, according to the docs here, so if you're running an older version, updating WordPress should help.

You also asked whether a plugin could cause it -- sometimes a plugin can cause core parts of WordPress to load in a different order, which can cause some functions to be missing when they should normally be defined, but I don't think it can cause this particular issue, since this function is defined fairly early when WordPress is loading.