{"id":17503536,"date":"2024-03-15T14:26:36","date_gmt":"2024-03-15T14:26:36","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=17503536"},"modified":"2024-03-15T14:34:12","modified_gmt":"2024-03-15T14:34:12","slug":"reinit-reload-function","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/reinit-reload-function\/","title":{"rendered":"Reinit\/Reload function?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>We use a self-made WordPress theme that behaves like a SPA through Swup.js<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem is that the plug-in looks at whether the page uses a Gutenslider and then adds various JavaScript files &amp; functions in the footer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because <a href=\"https:\/\/swup.js.org\/\">Swup.js<\/a> does not actually reload the page, we often experience plug-ins that no longer function properly. By placing an init function in an eventListener, the plug-ins often work correctly again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>swup.hooks.on('content:replace', () =&gt; { }<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I currently have an empty Gutenslider in the footer so that the necessary JS files are present on all pages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now I&#8217;m just looking for a function that I can call to initialize the Gutenslider. Does anyone know what function I can use for this?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We use<strong> <\/strong><em>Gutenslider v6.1.0<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thanks for contributing ideas!<\/p>\n","protected":false},"template":"","class_list":["post-17503536","topic","type-topic","status-publish","hentry","topic-tag-initialize","topic-tag-javascript","topic-tag-spa"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17503536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17503536\/revisions"}],"predecessor-version":[{"id":17503565,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17503536\/revisions\/17503565"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17503536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}