: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* @type string $redirect URL to redirect to. Must be absolute, as in "https://example.com/mypage/".
* Default is to redirect back to the request URI.
* @type string $form_id ID attribute value for the form. Default 'loginform'.
* @type string $label_username Label for the username or email address field. Default 'Username or Email Address'.
* @type string $label_password Label for the password field. Default 'Password'.
* @type string $label_remember Label for the remember field. Default 'Remember Me'.
* @type string $label_log_in Label for the submit button. Default 'Log In'.
* @type string $id_username ID attribute value for the username field. Default 'user_login'.
* @type string $id_password ID attribute value for the password field. Default 'user_pass'.
* @type string $id_remember ID attribute value for the remember field. Default 'rememberme'.
* @type string $id_submit ID attribute value for the submit button. Default 'wp-submit'.
* @type bool $remember Whether to display the "rememberme" checkbox in the form.
* @type string $value_username Default value for the username field. Default empty.
* @type bool $value_remember Whether the "Remember Me" checkbox should be checked by default.
* Default false (unchecked).
* @type bool $required_username Whether the username field has the 'required' attribute.
* @type bool $required_password Whether the password field has the 'required' attribute.
* @return void|string Void if 'echo' argument is true, login form HTML if 'echo' is false.
function wp_login_form( $args = array() ) {
// Default 'redirect' value takes the user back to the request URI.
'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
'form_id' => 'loginform',
'label_username' => __( 'Username or Email Address' ),
'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',
// Set 'value_remember' to true to default the "Remember me" checkbox to checked.
'value_remember' => false,
// Set 'required_username' to true to add the required attribute to username field.
'required_username' => false,
// Set 'required_password' to true to add the required attribute to password field.
'required_password' => false,
* Filters the default login form output arguments.
* @param array $defaults An array of default login form arguments.
$args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );
* Filters content to display at the top of the login form.
* The filter evaluates just following the opening form tag element.
* @param string $content Content to display. Default empty.
* @param array $args Array of login form arguments.
$login_form_top = apply_filters( 'login_form_top', '', $args );
* Filters content to display in the middle of the login form.
* The filter evaluates just following the location where the 'login-password'
* @param string $content Content to display. Default empty.
* @param array $args Array of login form arguments.
$login_form_middle = apply_filters( 'login_form_middle', '', $args );
* Filters content to display at the bottom of the login form.
* The filter evaluates just preceding the closing form tag element.
* @param string $content Content to display. Default empty.
* @param array $args Array of login form arguments.
$login_form_bottom = apply_filters( 'login_form_bottom', '', $args );
'<form name="%1$s" id="%1$s" action="%2$s" method="post">',
esc_attr( $args['form_id'] ),
esc_url( site_url( 'wp-login.php', 'login_post' ) )
'<p class="login-username">
<label for="%1$s">%2$s</label>
<input type="text" name="log" id="%1$s" autocomplete="username" class="input" value="%3$s" size="20"%4$s />
esc_attr( $args['id_username'] ),
esc_html( $args['label_username'] ),
esc_attr( $args['value_username'] ),
( $args['required_username'] ? ' required="required"' : '' )
'<p class="login-password">
<label for="%1$s">%2$s</label>
<input type="password" name="pwd" id="%1$s" autocomplete="current-password" spellcheck="false" class="input" value="" size="20"%3$s />
esc_attr( $args['id_password'] ),
esc_html( $args['label_password'] ),
( $args['required_password'] ? ' required="required"' : '' )
'<p class="login-remember"><label><input name="rememberme" type="checkbox" id="%1$s" value="forever"%2$s /> %3$s</label></p>',
esc_attr( $args['id_remember'] ),
( $args['value_remember'] ? ' checked="checked"' : '' ),
esc_html( $args['label_remember'] )
'<p class="login-submit">
<input type="submit" name="wp-submit" id="%1$s" class="button button-primary" value="%2$s" />
<input type="hidden" name="redirect_to" value="%3$s" />
esc_attr( $args['id_submit'] ),
esc_attr( $args['label_log_in'] ),
esc_url( $args['redirect'] )
* Returns the URL that allows the user to reset the lost password.
* @param string $redirect Path to redirect to on login.
* @return string Lost password URL.
function wp_lostpassword_url( $redirect = '' ) {
'action' => 'lostpassword',
if ( ! empty( $redirect ) ) {
$args['redirect_to'] = urlencode( $redirect );
$blog_details = get_site();
$wp_login_path = $blog_details->path . 'wp-login.php';
$wp_login_path = 'wp-login.php';
$lostpassword_url = add_query_arg( $args, network_site_url( $wp_login_path, 'login' ) );
* Filters the Lost Password URL.
* @param string $lostpassword_url The lost password page URL.
* @param string $redirect The path to redirect to on login.
return apply_filters( 'lostpassword_url', $lostpassword_url, $redirect );
* Displays 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.
* @param string $before Text to output before the link. Default `<li>`.
* @param string $after Text to output after the link. Default `</li>`.
* @param bool $display Default to echo and not return the link.
* @return void|string Void if `$display` argument is true, registration or admin link
* if `$display` is false.
function wp_register( $before = '<li>', $after = '</li>', $display = true ) {
if ( ! is_user_logged_in() ) {
if ( get_option( 'users_can_register' ) ) {
$link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __( 'Register' ) . '</a>' . $after;
} elseif ( current_user_can( 'read' ) ) {
$link = $before . '<a href="' . admin_url() . '">' . __( 'Site Admin' ) . '</a>' . $after;
* Filters the HTML link to the Registration or Admin page.
* Users are sent to the admin page if logged-in, or the registration page
* if enabled and logged-out.
* @param string $link The HTML code for the link to the Registration or Admin page.
$link = apply_filters( 'register', $link );
* Theme container function for the 'wp_meta' action.
* The {@see 'wp_meta'} action can have several purposes, depending on how you use it,
* but one purpose might have been to allow for theme switching.
* @link https://core.trac.wordpress.org/ticket/1458 Explanation of 'wp_meta' action.
* Fires before displaying echoed content in the sidebar.
* Displays information about the current site.
* @see get_bloginfo() For possible `$show` values
* @param string $show Optional. Site information to display. Default empty.
function bloginfo( $show = '' ) {
echo get_bloginfo( $show, 'display' );
* Retrieves information about the current site.
* Possible values for `$show` include:
* - 'name' - Site title (set in Settings > General)
* - 'description' - Site tagline (set in Settings > General)
* - 'wpurl' - The WordPress address (URL) (set in Settings > General)
* - 'url' - The Site address (URL) (set in Settings > General)
* - 'admin_email' - Admin email (set in Settings > General)
* - 'charset' - The "Encoding for pages and feeds" (set in Settings > Reading)
* - 'version' - The current WordPress version
* - 'html_type' - The Content-Type (default: "text/html"). Themes and plugins
* can override the default value using the {@see 'pre_option_html_type'} filter
* - 'text_direction' - The text direction determined by the site's language. is_rtl()
* - 'language' - Language code for the current site
* - 'stylesheet_url' - URL to the stylesheet for the active theme. An active child theme
* will take precedence over this value
* - 'stylesheet_directory' - Directory path for the active theme. An active child theme
* will take precedence over this value
* - 'template_url' / 'template_directory' - URL of the active theme's directory. An active
* child theme will NOT take precedence over this value
* - 'pingback_url' - The pingback XML-RPC file URL (xmlrpc.php)
* - 'atom_url' - The Atom feed URL (/feed/atom)
* - 'rdf_url' - The RDF/RSS 1.0 feed URL (/feed/rdf)
* - 'rss_url' - The RSS 0.92 feed URL (/feed/rss)
* - 'rss2_url' - The RSS 2.0 feed URL (/feed)
* - 'comments_atom_url' - The comments Atom feed URL (/comments/feed)
* - 'comments_rss2_url' - The comments RSS 2.0 feed URL (/comments/feed)
* Some `$show` values are deprecated and will be removed in future versions.
* These options will trigger the _deprecated_argument() function.
* Deprecated arguments include:
* - 'siteurl' - Use 'url' instead
* - 'home' - Use 'url' instead
* @global string $wp_version The WordPress version string.
* @param string $show Optional. Site info to retrieve. Default empty (site name).
* @param string $filter Optional. How to filter what is retrieved. Default 'raw'.
* @return string Mostly string values, might be empty.
function get_bloginfo( $show = '', $filter = 'raw' ) {
case 'home': // Deprecated.
case 'siteurl': // Deprecated.
/* translators: 1: 'siteurl'/'home' argument, 2: bloginfo() function name, 3: 'url' argument. */
__( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s option instead.' ),
'<code>' . $show . '</code>',
'<code>bloginfo()</code>',
// Intentional fall-through to be handled by the 'url' case.
$output = get_option( 'blogdescription' );
$output = get_feed_link( 'rdf' );
$output = get_feed_link( 'rss' );
$output = get_feed_link( 'rss2' );
$output = get_feed_link( 'atom' );
case 'comments_atom_url':
$output = get_feed_link( 'comments_atom' );
case 'comments_rss2_url':
$output = get_feed_link( 'comments_rss2' );
$output = site_url( 'xmlrpc.php' );
$output = get_stylesheet_uri();
case 'stylesheet_directory':
$output = get_stylesheet_directory_uri();
case 'template_directory':
$output = get_template_directory_uri();
$output = get_option( 'admin_email' );
$output = get_option( 'blog_charset' );
$output = get_option( 'html_type' );
* translators: Translate this to the correct language tag for your locale,
* see https://www.w3.org/International/articles/language-tags/ for reference.
* Do not translate into your own language.
$output = __( 'html_lang_attribute' );
if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) {
$output = determine_locale();
$output = str_replace( '_', '-', $output );
/* translators: 1: 'text_direction' argument, 2: bloginfo() function name, 3: is_rtl() function name. */
__( 'The %1$s option is deprecated for the family of %2$s functions. Use the %3$s function instead.' ),
'<code>' . $show . '</code>',
'<code>bloginfo()</code>',
if ( function_exists( 'is_rtl' ) ) {
$output = is_rtl() ? 'rtl' : 'ltr';
$output = get_option( 'blogname' );
if ( 'display' === $filter ) {
str_contains( $show, 'url' )
|| str_contains( $show, 'directory' )
|| str_contains( $show, 'home' )
* Filters the URL returned by get_bloginfo().
* @param string $output The URL returned by bloginfo().
* @param string $show Type of information requested.
$output = apply_filters( 'bloginfo_url', $output, $show );
* Filters the site information returned by get_bloginfo().
* @param mixed $output The requested non-URL site information.
* @param string $show Type of information requested.
$output = apply_filters( 'bloginfo', $output, $show );
* Returns the Site Icon URL.
* @param int $size Optional. Size of the site icon. Default 512 (pixels).
* @param string $url Optional. Fallback url if no site icon is found. Default empty.
* @param int $blog_id Optional. ID of the blog to get the site icon for. Default current blog.
* @return string Site Icon URL.
function get_site_icon_url( $size = 512, $url = '', $blog_id = 0 ) {
if ( is_multisite() && ! empty( $blog_id ) && get_current_blog_id() !== (int) $blog_id ) {
switch_to_blog( $blog_id );
$site_icon_id = (int) get_option( 'site_icon' );
$size_data = array( $size, $size );
$url = wp_get_attachment_image_url( $site_icon_id, $size_data );
* Filters the site icon URL.
* @param string $url Site icon URL.
* @param int $size Size of the site icon.
* @param int $blog_id ID of the blog to get the site icon for.
return apply_filters( 'get_site_icon_url', $url, $size, $blog_id );
* Displays the Site Icon URL.