openid-connect-generic
openid-connect-generic copied to clipboard
Provide new filter for alternate_redirect_uri
This is currently untested. Just a starting point.
All Submissions:
- [ ] Have you followed the plugin Contributing guideline?
- [ ] Does your code follow the WordPress' coding standards?
- [ ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Changes proposed in this Pull Request:
Provide a new filter for the alternate_redirect_uri for cases where the hardcoded value may not work. See #285
How to test the changes in this Pull Request:
- On the plugin settings page, enable the "Alternate Redirect URI" option.
- Write a custom hook in another plugin that changes the alternate redirect uri.
- Flush permalinks by visiting the site's permalink page.
- Test by performing normal OIDC login.
Generic example:
add_filter( 'openid-connect-generic-alter-alternate-redirect-uri', function( $redirect_uri ) {
// No preceeding or trailing slash.
return 'whatever-i-want-the-redirect-uri-to-be';
} );
Example specific to #285 :
add_filter( 'openid-connect-generic-alter-alternate-redirect-uri', function( $redirect_uri ) {
// No preceeding or trailing slash.
return 'ithemesfd/openid-connect-authorize';
} );
Changelog entry
Provide new filter for alternate_redirect_uri. Filter:
openid-connect-generic-alter-alternate-redirect-uri.
@daggerhart should we update the description of the "Alternate Redirect URI" settings section to mention the availability of the new filter? Also we need to make sure to update the Hooks & Filters Wiki documentation.
This would be really useful, can it be merged?