{"action":"created","issue":{"url":"https://api.github.com/repos/szepeviktor/fix-w3tc/issues/122","repository_url":"https://api.github.com/repos/szepeviktor/fix-w3tc","labels_url":"https://api.github.com/repos/szepeviktor/fix-w3tc/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/szepeviktor/fix-w3tc/issues/122/comments","events_url":"https://api.github.com/repos/szepeviktor/fix-w3tc/issues/122/events","html_url":"https://github.com/szepeviktor/fix-w3tc/issues/122","id":180133585,"number":122,"title":"Emoji and CDN","user":{"login":"vijayaraghavanramanan","id":13736892,"avatar_url":"https://avatars.githubusercontent.com/u/13736892?v=3","gravatar_id":"","url":"https://api.github.com/users/vijayaraghavanramanan","html_url":"https://github.com/vijayaraghavanramanan","followers_url":"https://api.github.com/users/vijayaraghavanramanan/followers","following_url":"https://api.github.com/users/vijayaraghavanramanan/following{/other_user}","gists_url":"https://api.github.com/users/vijayaraghavanramanan/gists{/gist_id}","starred_url":"https://api.github.com/users/vijayaraghavanramanan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijayaraghavanramanan/subscriptions","organizations_url":"https://api.github.com/users/vijayaraghavanramanan/orgs","repos_url":"https://api.github.com/users/vijayaraghavanramanan/repos","events_url":"https://api.github.com/users/vijayaraghavanramanan/events{/privacy}","received_events_url":"https://api.github.com/users/vijayaraghavanramanan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-29T18:58:46Z","updated_at":"2016-09-30T00:12:46Z","closed_at":null,"body":"Wordpress enqueues wp-emoji-release.min.js via inline feature detection. \r\n\r\nSo suppose my website is on the subdomain www.example.com and the CDN cname is cloud.example.com\r\n\r\nThe file path in browser should be http://cloud.example.com/wp-includes/js/wp-emoji-release.min.js?ver=4.6.1\r\n\r\nBut that is not the case. \r\n\r\nIt's probably because the URLs are JSONencoded in the inline JS in the HTML. "},"comment":{"url":"https://api.github.com/repos/szepeviktor/fix-w3tc/issues/comments/250627210","html_url":"https://github.com/szepeviktor/fix-w3tc/issues/122#issuecomment-250627210","issue_url":"https://api.github.com/repos/szepeviktor/fix-w3tc/issues/122","id":250627210,"user":{"login":"amiga-500","id":5191497,"avatar_url":"https://avatars.githubusercontent.com/u/5191497?v=3","gravatar_id":"","url":"https://api.github.com/users/amiga-500","html_url":"https://github.com/amiga-500","followers_url":"https://api.github.com/users/amiga-500/followers","following_url":"https://api.github.com/users/amiga-500/following{/other_user}","gists_url":"https://api.github.com/users/amiga-500/gists{/gist_id}","starred_url":"https://api.github.com/users/amiga-500/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiga-500/subscriptions","organizations_url":"https://api.github.com/users/amiga-500/orgs","repos_url":"https://api.github.com/users/amiga-500/repos","events_url":"https://api.github.com/users/amiga-500/events{/privacy}","received_events_url":"https://api.github.com/users/amiga-500/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T00:12:46Z","updated_at":"2016-09-30T00:12:46Z","body":"Hi @vijayaraghavanramanan \r\n\r\nOk i did some digging and yea because, as you even noticed, the url is JSON encoded within an inlined JS w3tc has no chance to modify the url to CDN.\r\n\r\nHowever, a solution would be to add the following lines into your theme's _functions.php_ file (don't forget to modify the _**cloud.example.com**_ part:\r\n\r\n```php\r\nfunction my_script_location( $script_url, $script_name ) {\r\n        global $wp_version;\r\n\tif ( $script_name == 'concatemoji') {\r\n\t\t$script_url = \"http://cloud.example.com/wp-includes/js/wp-emoji-release.min.js?ver=$wp_version\";\r\n\t}\r\n\r\n\treturn $script_url;\r\n}\r\nadd_filter( 'script_loader_src', 'my_script_location', 10, 2 );\r\n\r\n```\r\n\r\nCheers\r\nKimberly"}}
{"actor":{"display_login":"amiga-500"}}