Created
October 8, 2018 20:40
-
-
Save freddiemixell/60702fcf474b80a0f9c4199c6057a97f to your computer and use it in GitHub Desktop.
WordPress Open All Pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let htmlCollection = document.getElementsByClassName("row-title"); | |
| let rowTitle = Array.from(htmlCollection); | |
| rowTitle.map((t) => {t.setAttribute("onclick", "window.open(this.href);")}) | |
| function eventFire(el, etype){ | |
| if (el.fireEvent) { | |
| el.fireEvent('on' + etype); | |
| } else { | |
| var evObj = document.createEvent('Events'); | |
| evObj.initEvent(etype, true, false); | |
| el.dispatchEvent(evObj); | |
| } | |
| } | |
| rowTitle.map((f) => {eventFire(f, 'click');}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment