FALSE, 'reveal_registration' => TRUE, 'landing' => 'return', 'specific_url' => '', 'wplogin_php' => FALSE, 'custom_login' => FALSE, 'login_url' => '', 'custom_login_onsite' => TRUE, 'excl_url' => array(), 'excl_url_prefix' => array(), 'excl_home' => FALSE, 'check_role' => TRUE, 'override_omit' => FALSE ), array( 'user_submenu' ) ); $settings = get_option( 'jr_ps_settings' ); if ( is_admin() ) { require_once( jr_ps_path() . 'includes/all-admin.php' ); /* Support WordPress Version 3.0.x before is_network_admin() existed */ if ( function_exists( 'is_network_admin' ) && is_network_admin() ) { // Network Admin pages in Network/Multisite install if ( function_exists( 'is_plugin_active_for_network' ) && is_plugin_active_for_network( jr_ps_plugin_basename() ) ) { // Network Admin Settings page for Plugin require_once( jr_ps_path() . 'includes/net-settings.php' ); } } else { // Regular (non-Network) Admin pages // Settings page for Plugin require_once( jr_ps_path() . 'includes/admin-settings.php' ); } // All changes to all Admin-Installed Plugins pages require_once( jr_ps_path() . 'includes/installed-plugins.php' ); } else { /* Public WordPress content, i.e. - not Admin pages Do nothing if Private Site setting not set by Administrator */ if ( $settings['private_site'] ) { // Private Site code require_once( jr_ps_path() . 'includes/public.php' ); } } /** * Check for missing Settings and set them to defaults * * Ensures that the Named Setting exists, and populates it with defaults for any missing values. * Safe to use on every execution of a plugin because it only does an expensive Database Write * when it finds missing Settings. * * @param string $name Name of Settings as looked up with get_option() * @param array $defaults Each default Settings value in [key] => value format * @param array $deletes Each old Settings value to delete as [0] => key format * @return bool/Null Return value from update_option(), or NULL if update_option() not called */ function jr_ps_init_settings( $name, $defaults, $deletes = array() ) { $updated = FALSE; if ( FALSE === ( $settings = get_option( $name ) ) ) { $settings = $defaults; $updated = TRUE; } else { foreach ( $defaults as $key => $value ) { if ( !isset( $settings[$key] ) ) { $settings[$key] = $value; $updated = TRUE; } } foreach ( $deletes as $key ) { if ( isset( $settings[$key] ) ) { /* Don't need to check to UNSET, but do need to know to set $updated */ unset( $settings[$key] ); $updated = TRUE; } } } if ( $updated ) { $return = update_option( $name, $settings ); } else { $return = NULL; } return $return; } /* Documentation of Research Done for this Plugin: Registration URL (based on a root install in http://localhost): WordPress 3.6.1 without jonradio Private Site installed Single Site - not a network http://localhost/wp-login.php?action=register Primary Site of a Network http://localhost/wp-signup.php Secondary Site of a Network http://localhost/wp-signup.php This last URL needs a lot of thought because it means that what begins on one site ends up on another. WordPress 3.7-beta without jonradio Private Site installed Single Site - not a network http://localhost/wp-login.php?action=register Primary Site of a Network http://localhost/wp-signup.php Secondary Site of a Network http://localhost/wp-signup.php WordPress 3.0.0 without jonradio Private Site installed Single Site - not a network http://localhost/wp-login.php?action=register Primary Site of a Network http://localhost/wp-signup.php Secondary Site of a Network http://localhost/wp-signup.php wp_registration_url() was not available prior to WordPress Version 3.6.0 Self-Registration allows potential Users to Register their own ID and Password without Administrator intervention or knowledge. It is controlled by: get_option( 'users_can_register' ) - non-Network '1' - allows Self-Registration '0' - no Self-Registration get_site_option( 'registration' ) - Network (Multisite) 'user' - allows Self-Registration 'none' - no Self-Registration 'blog' - Users can create new Sites in a Network 'all' - allows Self-Registration and the creation of new Sites in a Network */ ?>