Title: Adding additional function to button
Last modified: September 1, 2016

---

# Adding additional function to button

 *  Resolved [black1992](https://wordpress.org/support/users/black1992/)
 * (@black1992)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/adding-additional-function-to-button/)
 * Hello,
 * I am creating an escape button for a domestic violence website. Although I currently
   have it set up to quickly transition to a different page, there is still the 
   issue of the victim being forced to hit the back button or check the history.
   I have a popup that encouraged users to brown with an incognito browser. So that
   leaves the issues of the back button as the main problem. I have been viewing
   the discussion on this website: [http://stackoverflow.com/questions/22648829/fastest-exit-strategy-for-a-panic-button-in-crisis-abuse-websites](http://stackoverflow.com/questions/22648829/fastest-exit-strategy-for-a-panic-button-in-crisis-abuse-websites).
   A situation that is basically identical to mine. Would it be possible to use 
   his code:
 * panic= function(){
    document.body.innerHTML = ”; //this clears the current html
   in the body //making it look like the page is loading
 *  if(…){ //check if replaceState is supported so no error is thrown
    var title
   =”Decoy Article Title”, url=”/decoypage”; //another endpoint on your server that
   gives the decoy website window.history.replaceState(“”, title , url); //replace
   current history entry }
 *  //should be pretty fast up to this point
    window.location.replace(“[http://www.google.com&#8221](http://www.google.com&#8221););//
   load the google page or my alternative. }
 * Or create some other type of command that doesnt allow the back button to be 
   hit at the very least. I am not very good with html, so the website linked my
   be of no use. BUt I was hoping to still use the awesome WPi to solve this issue.
 * Thanks!
 * [http://www.thehopecenterinc.com/](http://www.thehopecenterinc.com/)
 * [https://wordpress.org/plugins/wpi-designer-button-shortcode/](https://wordpress.org/plugins/wpi-designer-button-shortcode/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [WooPrali](https://wordpress.org/support/users/wooprali/)
 * (@wooprali)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/adding-additional-function-to-button/#post-7660563)
 * Hi,
 * Thanks for using designer button plugin.
 * If possible i will implement JavaScript feature for the button in the next version.
 * Regards,
 * PRALI
 *  Plugin Author [WooPrali](https://wordpress.org/support/users/wooprali/)
 * (@wooprali)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/adding-additional-function-to-button/#post-8282694)
 * Hi,
 * Please update the plugin to its latest version.
 * Regards,
 * Prali

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding additional function to button’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpi-designer-button-shortcode_413a0e.
   svg)
 * [WPi Designer Button](https://wordpress.org/plugins/wpi-designer-button-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpi-designer-button-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpi-designer-button-shortcode/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [function](https://wordpress.org/support/topic-tag/function/)

 * 2 replies
 * 2 participants
 * Last reply from: [WooPrali](https://wordpress.org/support/users/wooprali/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/adding-additional-function-to-button/#post-8282694)
 * Status: resolved