Skip to content

Instantly share code, notes, and snippets.

@altoin
Created January 30, 2019 19:54
Show Gist options
  • Save altoin/3157b332488a754988bd134b0dbd535c to your computer and use it in GitHub Desktop.
Save altoin/3157b332488a754988bd134b0dbd535c to your computer and use it in GitHub Desktop.
Change default entry ID to your custom slug
<?php
add_filter('gravityview_entry_slug', 'change_the_gravityview_entry_slug');
/**
* Change the /123/ URL piece to /myslug/
* @param string $slug Previous slug, default: "entryId"
* @return string Change the new endpoint to "myslug"
*/
function change_the_gravityview_entry_slug( $slug ) {
return 'myslug';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment