Last active
June 11, 2018 17:15
-
-
Save rafaehlers/7f51575ec583a95e555ee17ce4bddad5 to your computer and use it in GitHub Desktop.
Change the back link for just a specific View ID
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
<?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