wp_loginout

Advertisement

Summery Summery

Display the Log In/Out link.

Syntax Syntax

wp_loginout( string $redirect = '', bool $echo = true )

Description Description

Displays a link, which allows users to navigate to the Log In page to log in or log out depending on whether they are currently logged in.

Parameters Parameters

$redirect

(Optional) path to redirect to on login/logout.

Default value: ''

$echo

(Optional) Default to echo and not return the link.

Default value: true

Return Return

(void|string) Void if $echo argument is true, log in/out link if $echo is false.

Source Source

File: wp-includes/general-template.php

				<input type="submit" class="search-submit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
			</form>';
		} else {
			$form = '<form role="search" ' . $aria_label . 'method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
				<div>
					<label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
					<input type="text" value="' . get_search_query() . '" name="s" id="s" />
					<input type="submit" id="searchsubmit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
				</div>
			</form>';
		}
	}

	/**
	 * Filters the HTML output of the search form.
	 *
	 * @since 2.7.0
	 * @since 5.5.0 The `$args` parameter was added.
	 *
	 * @param string $form The search form HTML output.
	 * @param array  $args The array of arguments for building the search form.

Advertisement

Changelog Changelog

Changelog
Version Description
1.5.0 Introduced.

Advertisement

Leave a Reply