jQuery typeerror invalid ‘in’ operand a after WordPress upgrade

Changing the starting and end tags of the products loop in main shop page of a WooCommerce theme
Changing starting and ending tags of the products loop in main shop page of a WooCommerce theme
December 15, 2015
search and replace plugin for WordPress
Search and Replace Plugin for WordPress
March 24, 2016
Show all

jQuery typeerror invalid ‘in’ operand a after WordPress upgrade

jQuery typeerror invalid - advanced custom fields pro plugin

If you have happened to see this error “jQuery typeerror invalid ‘in’ operand a” in javascript console then it is most probably due to a third party library causing the error. Recently I updated a WordPress core to latest version of 4.4.1 and all of a sudden the ajax based page/post saving functionality of the website broke.

I invested the website to find out the cause of the problem. After disabling all the plugins I was still getting the problem. I wasn’t using any custom javascript code for the backend functionality but still I went to functions.php in desperate need of solving the problem as I had already wasted many hours to find the cause and fix it. When I opened the functions.php and looked through it, I noticed that I was using Advanced Custom Fields Pro plugin by including it through functions.php. I disabled it and voila! The problem was gone. So the culprit was Advanced Custom Fields Pro 5.1.3 and upgrading it to 5.3.2 solved the problem.

If you happen not to be able to save/edit posts/pages after WordPress core upgrade and are using Advanced Custom Fields Pro or any other plugin by using it through include directives then make sure to update those plugins as well.

Sher Ali Saafi
Sher Ali Saafi
Sher Ali Saafi is a software engineer, WordPress Rockstar and Envato Elite Author. When he is not found in front of machines then he is most probably somewhere in the mountains to explore new territories. You can find his travel photography at http://sheraliphotography.com/ and read about his travel experiences at http://thesilenttraveler.com/

Leave a Reply

Your email address will not be published. Required fields are marked *