-
-
Save zackkatz/c71ef120e13dfb9ea7432a24f46df9f9 to your computer and use it in GitHub Desktop.
GravityView - Change the back link URL for a specific View ID
This file contains 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
<?php | |
add_action( 'gravityview/template/links/back/url', 'gv_change_back_link', 10, 2 ); | |
/** | |
* Modify the back link URL for a specific View | |
* | |
* @param string $href The original back link | |
* @param \GV\Template_Context The current context | |
* | |
* @return string Modified URL, if View ID equals 105 | |
*/ | |
function gv_change_back_link( $href = '', $context = null ) { | |
if( 105 === $context->view->ID ) { | |
return 'https://example.com/my-custom-page/'; | |
} | |
return $href; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!
I used this to maintain parameters being passed to the Multiple Entries page which filters table contents.