Last active
May 1, 2018 14:31
-
-
Save ProjectKarol/25bfe14cfb68f515e50c4de230c34aef to your computer and use it in GitHub Desktop.
Simple way to integrate Geo My WP witch BP profile Search
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
1 st | |
Crate two button to execute search and reset in two forms in the same time. | |
<input type="button" onclick="simulateClicksearLocation(); simulateClickSearchBudypress();" value="search click"/> | |
<input type="button" onclick="simulateClick(); restetBpProfileSearch();" value="reset click"/> | |
2nd | |
Wrote js functions so simiulate click button | |
js functions to simulate button click, | |
<script> | |
function simulateClick() { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
var cb = document.getElementById("gmw-kleo-geo-members-reset-form-button"); | |
var canceled = !cb.dispatchEvent(evt); | |
} | |
function restetBpProfileSearch() { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
var cb = document.querySelector('.bps_filters a'); | |
var canceled = !cb.dispatchEvent(evt); | |
} | |
function simulateClicksearLocation() { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
var cb = document.getElementById("members_search_submit"); | |
var canceled = !cb.dispatchEvent(evt); | |
} | |
function simulateClickSearchBudypress() { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, | |
0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
var cb = document.querySelector('#buddypress .form-submit'); | |
var canceled = !cb.dispatchEvent(evt); | |
} | |
</script> | |
3rd. On the end use some css to hide original search buttons on GMW an BPS. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment