From ff02fb6eb5384cd1ab23ae5e9a0ee826c276d9f5 Mon Sep 17 00:00:00 2001 From: Dac Chartrand Date: Wed, 31 Jan 2018 14:03:55 -0500 Subject: [PATCH] Ensure support for OAuth registration/sign in (#70) --- inc/helpers/namespace.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/inc/helpers/namespace.php b/inc/helpers/namespace.php index b49f072..52c3d9f 100644 --- a/inc/helpers/namespace.php +++ b/inc/helpers/namespace.php @@ -204,14 +204,18 @@ function get_default_menu( $items = '' ) { * Echo the default menu. * * @param string $items - * - * @return null */ function default_menu( $args = [], $items = '' ) { printf( "<{$args['container']} id='{$args['container_id']}' class='{$args['container_class']}'>", get_default_menu( $items ) ); + if ( class_exists( '\PressbooksOAuth\OAuth' ) ) { + add_filter( 'pb_oauth_output_button', function( $bool ) { + return false; + } ); + do_action( 'pressbooks_oauth_connect' ); + } } /** @@ -222,7 +226,7 @@ function default_menu( $args = [], $items = '' ) { */ function handle_contact_form_submission() { if ( ! isset( $_POST['pb_root_contact_form_nonce'] ) || ! wp_verify_nonce( $_POST['pb_root_contact_form_nonce'], 'pb_root_contact_form' ) ) { - return; // Security check failed. + return false; // Security check failed. } if ( isset( $_POST['submitted'] ) ) { $output = [];