{"action":"created","issue":{"url":"https://api.github.com/repos/pojome/elementor/issues/3994","repository_url":"https://api.github.com/repos/pojome/elementor","labels_url":"https://api.github.com/repos/pojome/elementor/issues/3994/labels{/name}","comments_url":"https://api.github.com/repos/pojome/elementor/issues/3994/comments","events_url":"https://api.github.com/repos/pojome/elementor/issues/3994/events","html_url":"https://github.com/pojome/elementor/issues/3994","id":310990894,"number":3994,"title":"Feature Request: Configuration option to allow scripts to be loaded in wp_head instead of wp_footer.","user":{"login":"AndrewPenry","id":730188,"avatar_url":"https://avatars3.githubusercontent.com/u/730188?v=4","gravatar_id":"","url":"https://api.github.com/users/AndrewPenry","html_url":"https://github.com/AndrewPenry","followers_url":"https://api.github.com/users/AndrewPenry/followers","following_url":"https://api.github.com/users/AndrewPenry/following{/other_user}","gists_url":"https://api.github.com/users/AndrewPenry/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewPenry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewPenry/subscriptions","organizations_url":"https://api.github.com/users/AndrewPenry/orgs","repos_url":"https://api.github.com/users/AndrewPenry/repos","events_url":"https://api.github.com/users/AndrewPenry/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewPenry/received_events","type":"User","site_admin":false},"labels":[{"id":761175599,"url":"https://api.github.com/repos/pojome/elementor/labels/Waiting%20For%20Input","name":"Waiting For Input","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-03T20:41:20Z","updated_at":"2018-04-08T21:01:04Z","closed_at":"2018-04-08T21:01:04Z","author_association":"NONE","body":"In almost all cases, you would not want to do this. But in some rare edge cases, dumping the scripts into the head (so they are blocking) instead of at the bottom solves some problems.\r\n\r\nMy edge case is that I am importing the head template of Magento 2 site. Magento 2 uses a modified version of RequireJS. So any script that is loaded after RequireJS  which includes an anonymous define function will cause problems. One solution would be rewriting WP to use require (which some have suggested). A much simpler solution is to just load all of WP and Elementor's scripts into the head as blocking scripts before Magento's. This ensures that all of WP's stuff is loaded before RequireJS gets in there.\r\n\r\nI've modified frontend.php to register the scripts to the head, and enqueue them in the constructor. Most scripts end up in the head this way, although a few (like slick) still end up at the footer. This seems to work, and I can, of course, redo these changes when upgrading. It would be nice to have a configuration option for this."},"comment":{"url":"https://api.github.com/repos/pojome/elementor/issues/comments/379582257","html_url":"https://github.com/pojome/elementor/issues/3994#issuecomment-379582257","issue_url":"https://api.github.com/repos/pojome/elementor/issues/3994","id":379582257,"user":{"login":"bainternet","id":660572,"avatar_url":"https://avatars1.githubusercontent.com/u/660572?v=4","gravatar_id":"","url":"https://api.github.com/users/bainternet","html_url":"https://github.com/bainternet","followers_url":"https://api.github.com/users/bainternet/followers","following_url":"https://api.github.com/users/bainternet/following{/other_user}","gists_url":"https://api.github.com/users/bainternet/gists{/gist_id}","starred_url":"https://api.github.com/users/bainternet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bainternet/subscriptions","organizations_url":"https://api.github.com/users/bainternet/orgs","repos_url":"https://api.github.com/users/bainternet/repos","events_url":"https://api.github.com/users/bainternet/events{/privacy}","received_events_url":"https://api.github.com/users/bainternet/received_events","type":"User","site_admin":false},"created_at":"2018-04-08T21:01:04Z","updated_at":"2018-04-08T21:01:04Z","author_association":"COLLABORATOR","body":"@AndrewPenry \r\n\r\nWhat can i say, its not something we are going to implement, it simply goes against every page optimization guide out there (loading all the scripts in head).\r\n\r\n\r\nCurrently, this feature is not supported, but we will look into it in the future if we see a large demand for it.\r\n\r\nThanks for the feedback."}}
{"actor":{"display_login":"bainternet"}}