{"id":1172370,"date":"2016-10-04T09:35:34","date_gmt":"2016-10-04T16:35:34","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/"},"modified":"2016-10-04T09:35:34","modified_gmt":"2016-10-04T16:35:34","slug":"jquery-handle-issue","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/","title":{"rendered":"jQuery Handle Issue"},"content":{"rendered":"<p>Hello there!<\/p>\n<p>We ran into an issue where The Events Calendar wasn&#8217;t working correctly. All of our theme JS was working correctly (built from a custom theme boilerplate we created called <a href=\"http:\/\/github.com\/factor1\/prelude-wp\">prelude-wp<\/a>), but the archive view for TEC was failing (but with no errors in the console &#8211; see front end issue in screenshot). <\/p>\n<p>I spent a lot of time deferring scripts, changing jQuery versions, disabling plugins to no avail. It still kept failing. If and when I did get TEC to work correctly, the rest of our theme JS would fail. I narrowed it down to one function in functions.php where we deregister the WordPress jQuery version and register our own:<\/p>\n<pre><code>\/**\n* Load jQuery\n*\/\nif ( !is_admin() ) {\n    add_action(&#039;wp_enqueue_scripts&#039;,function() {\n        wp_deregister_script(&#039;jquery&#039;);\n        wp_register_script(&#039;prelude_jquery&#039;, (&#039;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/2.2.0\/jquery.min.js&#039;), false);\n        wp_enqueue_script(&#039;prelude_jquery&#039;);\n    });\n}<\/code><\/pre>\n<p>I found that changing our new jQuery enqueue handle back to just &#8220;jquery&#8221; fixes the issue all around, TEC works, our custom JS works. All is peachy. My question\/concern is why this is the case? Is the TEC plugin reliant on a script dependency called &#8220;jquery?&#8221; The reason we changed the new jQuery handle was to avoid conflicts with other plugins (we had a plugin that was disabling jQuery automatically at one point).<\/p>\n<p>Thanks for any insight! <\/p>\n","protected":false},"template":"","class_list":["post-1172370","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>jQuery Handle Issue -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"jQuery Handle Issue -\" \/>\n<meta property=\"og:description\" content=\"Hello there! We ran into an issue where The Events Calendar wasn&#8217;t working correctly. All of our theme JS was working correctly (built from a custom theme boilerplate we created called prelude-wp), but the archive view for TEC was failing (but with no errors in the console &#8211; see front end issue in screenshot). I [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/\",\"name\":\"jQuery Handle Issue -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2016-10-04T16:35:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"jQuery Handle Issue\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"jQuery Handle Issue -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/","og_locale":"en_US","og_type":"article","og_title":"jQuery Handle Issue -","og_description":"Hello there! We ran into an issue where The Events Calendar wasn&#8217;t working correctly. All of our theme JS was working correctly (built from a custom theme boilerplate we created called prelude-wp), but the archive view for TEC was failing (but with no errors in the console &#8211; see front end issue in screenshot). I [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/","name":"jQuery Handle Issue -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2016-10-04T16:35:34+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/jquery-handle-issue\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"jQuery Handle Issue"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1172370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1172370\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1172370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}