How to add a callback URI
-
I am currently creating my first plugin which uses SSO and I need to create a callback URI such as https://www.example.com/auth?vars=
I have tried External Rules without success and with no obvious way to clean up the rules on deactivation, using –
global $wp_rewrite; $plugin_url = plugins_url( 'my-api.php', __FILE__ ); $plugin_url = substr( $plugin_url, strlen( home_url() ) + 1 ); // The pattern is prefixed with '^' // The substitution is prefixed with the "home root", at least a '/' // This is equivalent to appending it to <code>non_wp_rules</code> $wp_rewrite->add_external_rule( 'my-api.php$', $plugin_url ); rule( 'auth', $plugin_url );
As well as tried Internal Rules without success, using –
add_action( 'init', 'init_internal' ); add_filter( 'query_vars', 'query_vars' ); add_action( 'parse_request', 'parse_request' );
I have been through the codex, google , forums etc and I’m obviously missing something obvious. Any code examples or clues as to what im doing majorly wrong.
Is there a PHP/worpress config option I’m missing possibly?
- The topic ‘How to add a callback URI’ is closed to new replies.