+ return apply_filters('logout_url', $logout_url, $redirect);
+}
+
+/**
+ * Returns the Log In URL.
+ *
+ * Returns the URL that allows the user to log in to the site.
+ *
+ * @since 2.7.0
+ * @uses site_url() To generate the log in URL.
+ * @uses apply_filters() calls 'login_url' hook on final login URL.
+ *
+ * @param string $redirect Path to redirect to on login.
+ * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
+ * @return string A log in URL.
+ */
+function wp_login_url($redirect = '', $force_reauth = false) {
+ $login_url = site_url('wp-login.php', 'login');
+
+ if ( !empty($redirect) )
+ $login_url = add_query_arg('redirect_to', urlencode($redirect), $login_url);
+
+ if ( $force_reauth )
+ $login_url = add_query_arg('reauth', '1', $login_url);
+
+ return apply_filters('login_url', $login_url, $redirect);
+}
+
+/**
+ * Returns the user registration URL.
+ *
+ * Returns the URL that allows the user to register on the site.
+ *
+ * @since 3.6.0
+ * @uses site_url() To generate the registration URL.
+ * @uses apply_filters() calls 'register_url' hook on final URL.
+ *
+ * @return string
+ */
+function wp_registration_url() {
+ return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
+}
+
+/**
+ * Provides a simple login form for use anywhere within WordPress. By default, it echoes
+ * the HTML immediately. Pass array('echo'=>false) to return the string instead.
+ *
+ * @since 3.0.0
+ * @param array $args Configuration options to modify the form output.
+ * @return string|null String when retrieving, null when displaying.
+ */
+function wp_login_form( $args = array() ) {
+ $defaults = array(
+ 'echo' => true,
+ 'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], // Default redirect is back to the current page
+ 'form_id' => 'loginform',
+ 'label_username' => __( 'Username' ),
+ 'label_password' => __( 'Password' ),
+ 'label_remember' => __( 'Remember Me' ),
+ 'label_log_in' => __( 'Log In' ),
+ 'id_username' => 'user_login',
+ 'id_password' => 'user_pass',
+ 'id_remember' => 'rememberme',
+ 'id_submit' => 'wp-submit',
+ 'remember' => true,
+ 'value_username' => '',
+ 'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked
+ );
+ $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );
+
+ $form = '
+ <form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url( site_url( 'wp-login.php', 'login_post' ) ) . '" method="post">
+ ' . apply_filters( 'login_form_top', '', $args ) . '
+ <p class="login-username">
+ <label for="' . esc_attr( $args['id_username'] ) . '">' . esc_html( $args['label_username'] ) . '</label>
+ <input type="text" name="log" id="' . esc_attr( $args['id_username'] ) . '" class="input" value="' . esc_attr( $args['value_username'] ) . '" size="20" />
+ </p>
+ <p class="login-password">
+ <label for="' . esc_attr( $args['id_password'] ) . '">' . esc_html( $args['label_password'] ) . '</label>
+ <input type="password" name="pwd" id="' . esc_attr( $args['id_password'] ) . '" class="input" value="" size="20" />
+ </p>
+ ' . apply_filters( 'login_form_middle', '', $args ) . '
+ ' . ( $args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr( $args['id_remember'] ) . '" value="forever"' . ( $args['value_remember'] ? ' checked="checked"' : '' ) . ' /> ' . esc_html( $args['label_remember'] ) . '</label></p>' : '' ) . '
+ <p class="login-submit">
+ <input type="submit" name="wp-submit" id="' . esc_attr( $args['id_submit'] ) . '" class="button-primary" value="' . esc_attr( $args['label_log_in'] ) . '" />
+ <input type="hidden" name="redirect_to" value="' . esc_url( $args['redirect'] ) . '" />
+ </p>
+ ' . apply_filters( 'login_form_bottom', '', $args ) . '
+ </form>';
+
+ if ( $args['echo'] )
+ echo $form;
+ else
+ return $form;
+}
+
+/**
+ * Returns the Lost Password URL.
+ *
+ * Returns the URL that allows the user to retrieve the lost password
+ *
+ * @since 2.8.0
+ * @uses site_url() To generate the lost password URL
+ * @uses apply_filters() calls 'lostpassword_url' hook on the lostpassword url
+ *
+ * @param string $redirect Path to redirect to on login.
+ * @return string Lost password URL.
+ */
+function wp_lostpassword_url( $redirect = '' ) {
+ $args = array( 'action' => 'lostpassword' );
+ if ( !empty($redirect) ) {
+ $args['redirect_to'] = $redirect;
+ }
+
+ $lostpassword_url = add_query_arg( $args, network_site_url('wp-login.php', 'login') );
+ return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
+}
+
+/**
+ * Display the Registration or Admin link.
+ *
+ * Display a link which allows the user to navigate to the registration page if
+ * not logged in and registration is enabled or to the dashboard if logged in.
+ *
+ * @since 1.5.0
+ * @uses apply_filters() Calls 'register' hook on register / admin link content.
+ *
+ * @param string $before Text to output before the link (defaults to <li>).
+ * @param string $after Text to output after the link (defaults to </li>).
+ * @param boolean $echo Default to echo and not return the link.
+ * @return string|null String when retrieving, null when displaying.
+ */
+function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {