Skip to content

Commit

Permalink
Hide the signup tab if registrations are turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed May 10, 2018
1 parent 014529c commit 5b08e93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lib/WP_Auth0_Lock10_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ public function get_lock_options() {

$options_obj = array_replace_recursive( $extraOptions, $options_obj, $extended_settings );

if ( ! $this->wp_options->is_wp_registration_enabled() && ! isset( $options_obj["allowSignUp"] )) {
$options_obj["allowSignUp"] = false;
}

if ( ! $this->show_as_modal() ) {
$options_obj['container'] = WPA0_AUTH0_LOGIN_FORM_ID;
}
Expand Down
5 changes: 1 addition & 4 deletions lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ public static function Instance() {
}

public function is_wp_registration_enabled() {
if ( is_multisite() ) {
return users_can_register_signup_filter();
}
return get_site_option( 'users_can_register', 0 ) == 1;
return is_multisite() ? users_can_register_signup_filter() : get_site_option( 'users_can_register' );
}

public function set_connection( $key, $value ) {
Expand Down

0 comments on commit 5b08e93

Please sign in to comment.