Edit File by line
/home/barbar84/public_h.../wp-inclu...
File: general-template.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* General template tags that can go anywhere in a template.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Template
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Load header template.
[9] Fix | Delete
*
[10] Fix | Delete
* Includes the header template for a theme or if a name is specified then a
[11] Fix | Delete
* specialised header will be included.
[12] Fix | Delete
*
[13] Fix | Delete
* For the parameter, if the file is called "header-special.php" then specify
[14] Fix | Delete
* "special".
[15] Fix | Delete
*
[16] Fix | Delete
* @since 1.5.0
[17] Fix | Delete
* @since 5.5.0 A return value was added.
[18] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[19] Fix | Delete
*
[20] Fix | Delete
* @param string $name The name of the specialised header.
[21] Fix | Delete
* @param array $args Optional. Additional arguments passed to the header template.
[22] Fix | Delete
* Default empty array.
[23] Fix | Delete
* @return void|false Void on success, false if the template does not exist.
[24] Fix | Delete
*/
[25] Fix | Delete
function get_header( $name = null, $args = array() ) {
[26] Fix | Delete
/**
[27] Fix | Delete
* Fires before the header template file is loaded.
[28] Fix | Delete
*
[29] Fix | Delete
* @since 2.1.0
[30] Fix | Delete
* @since 2.8.0 The `$name` parameter was added.
[31] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[32] Fix | Delete
*
[33] Fix | Delete
* @param string|null $name Name of the specific header file to use. Null for the default header.
[34] Fix | Delete
* @param array $args Additional arguments passed to the header template.
[35] Fix | Delete
*/
[36] Fix | Delete
do_action( 'get_header', $name, $args );
[37] Fix | Delete
[38] Fix | Delete
$templates = array();
[39] Fix | Delete
$name = (string) $name;
[40] Fix | Delete
if ( '' !== $name ) {
[41] Fix | Delete
$templates[] = "header-{$name}.php";
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
$templates[] = 'header.php';
[45] Fix | Delete
[46] Fix | Delete
if ( ! locate_template( $templates, true, true, $args ) ) {
[47] Fix | Delete
return false;
[48] Fix | Delete
}
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* Load footer template.
[53] Fix | Delete
*
[54] Fix | Delete
* Includes the footer template for a theme or if a name is specified then a
[55] Fix | Delete
* specialised footer will be included.
[56] Fix | Delete
*
[57] Fix | Delete
* For the parameter, if the file is called "footer-special.php" then specify
[58] Fix | Delete
* "special".
[59] Fix | Delete
*
[60] Fix | Delete
* @since 1.5.0
[61] Fix | Delete
* @since 5.5.0 A return value was added.
[62] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[63] Fix | Delete
*
[64] Fix | Delete
* @param string $name The name of the specialised footer.
[65] Fix | Delete
* @param array $args Optional. Additional arguments passed to the footer template.
[66] Fix | Delete
* Default empty array.
[67] Fix | Delete
* @return void|false Void on success, false if the template does not exist.
[68] Fix | Delete
*/
[69] Fix | Delete
function get_footer( $name = null, $args = array() ) {
[70] Fix | Delete
/**
[71] Fix | Delete
* Fires before the footer template file is loaded.
[72] Fix | Delete
*
[73] Fix | Delete
* @since 2.1.0
[74] Fix | Delete
* @since 2.8.0 The `$name` parameter was added.
[75] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[76] Fix | Delete
*
[77] Fix | Delete
* @param string|null $name Name of the specific footer file to use. Null for the default footer.
[78] Fix | Delete
* @param array $args Additional arguments passed to the footer template.
[79] Fix | Delete
*/
[80] Fix | Delete
do_action( 'get_footer', $name, $args );
[81] Fix | Delete
[82] Fix | Delete
$templates = array();
[83] Fix | Delete
$name = (string) $name;
[84] Fix | Delete
if ( '' !== $name ) {
[85] Fix | Delete
$templates[] = "footer-{$name}.php";
[86] Fix | Delete
}
[87] Fix | Delete
[88] Fix | Delete
$templates[] = 'footer.php';
[89] Fix | Delete
[90] Fix | Delete
if ( ! locate_template( $templates, true, true, $args ) ) {
[91] Fix | Delete
return false;
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
/**
[96] Fix | Delete
* Load sidebar template.
[97] Fix | Delete
*
[98] Fix | Delete
* Includes the sidebar template for a theme or if a name is specified then a
[99] Fix | Delete
* specialised sidebar will be included.
[100] Fix | Delete
*
[101] Fix | Delete
* For the parameter, if the file is called "sidebar-special.php" then specify
[102] Fix | Delete
* "special".
[103] Fix | Delete
*
[104] Fix | Delete
* @since 1.5.0
[105] Fix | Delete
* @since 5.5.0 A return value was added.
[106] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[107] Fix | Delete
*
[108] Fix | Delete
* @param string $name The name of the specialised sidebar.
[109] Fix | Delete
* @param array $args Optional. Additional arguments passed to the sidebar template.
[110] Fix | Delete
* Default empty array.
[111] Fix | Delete
* @return void|false Void on success, false if the template does not exist.
[112] Fix | Delete
*/
[113] Fix | Delete
function get_sidebar( $name = null, $args = array() ) {
[114] Fix | Delete
/**
[115] Fix | Delete
* Fires before the sidebar template file is loaded.
[116] Fix | Delete
*
[117] Fix | Delete
* @since 2.2.0
[118] Fix | Delete
* @since 2.8.0 The `$name` parameter was added.
[119] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[120] Fix | Delete
*
[121] Fix | Delete
* @param string|null $name Name of the specific sidebar file to use. Null for the default sidebar.
[122] Fix | Delete
* @param array $args Additional arguments passed to the sidebar template.
[123] Fix | Delete
*/
[124] Fix | Delete
do_action( 'get_sidebar', $name, $args );
[125] Fix | Delete
[126] Fix | Delete
$templates = array();
[127] Fix | Delete
$name = (string) $name;
[128] Fix | Delete
if ( '' !== $name ) {
[129] Fix | Delete
$templates[] = "sidebar-{$name}.php";
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
$templates[] = 'sidebar.php';
[133] Fix | Delete
[134] Fix | Delete
if ( ! locate_template( $templates, true, true, $args ) ) {
[135] Fix | Delete
return false;
[136] Fix | Delete
}
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
/**
[140] Fix | Delete
* Loads a template part into a template.
[141] Fix | Delete
*
[142] Fix | Delete
* Provides a simple mechanism for child themes to overload reusable sections of code
[143] Fix | Delete
* in the theme.
[144] Fix | Delete
*
[145] Fix | Delete
* Includes the named template part for a theme or if a name is specified then a
[146] Fix | Delete
* specialised part will be included. If the theme contains no {slug}.php file
[147] Fix | Delete
* then no template will be included.
[148] Fix | Delete
*
[149] Fix | Delete
* The template is included using require, not require_once, so you may include the
[150] Fix | Delete
* same template part multiple times.
[151] Fix | Delete
*
[152] Fix | Delete
* For the $name parameter, if the file is called "{slug}-special.php" then specify
[153] Fix | Delete
* "special".
[154] Fix | Delete
*
[155] Fix | Delete
* @since 3.0.0
[156] Fix | Delete
* @since 5.5.0 A return value was added.
[157] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[158] Fix | Delete
*
[159] Fix | Delete
* @param string $slug The slug name for the generic template.
[160] Fix | Delete
* @param string $name The name of the specialised template.
[161] Fix | Delete
* @param array $args Optional. Additional arguments passed to the template.
[162] Fix | Delete
* Default empty array.
[163] Fix | Delete
* @return void|false Void on success, false if the template does not exist.
[164] Fix | Delete
*/
[165] Fix | Delete
function get_template_part( $slug, $name = null, $args = array() ) {
[166] Fix | Delete
/**
[167] Fix | Delete
* Fires before the specified template part file is loaded.
[168] Fix | Delete
*
[169] Fix | Delete
* The dynamic portion of the hook name, `$slug`, refers to the slug name
[170] Fix | Delete
* for the generic template part.
[171] Fix | Delete
*
[172] Fix | Delete
* @since 3.0.0
[173] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[174] Fix | Delete
*
[175] Fix | Delete
* @param string $slug The slug name for the generic template.
[176] Fix | Delete
* @param string|null $name The name of the specialized template.
[177] Fix | Delete
* @param array $args Additional arguments passed to the template.
[178] Fix | Delete
*/
[179] Fix | Delete
do_action( "get_template_part_{$slug}", $slug, $name, $args );
[180] Fix | Delete
[181] Fix | Delete
$templates = array();
[182] Fix | Delete
$name = (string) $name;
[183] Fix | Delete
if ( '' !== $name ) {
[184] Fix | Delete
$templates[] = "{$slug}-{$name}.php";
[185] Fix | Delete
}
[186] Fix | Delete
[187] Fix | Delete
$templates[] = "{$slug}.php";
[188] Fix | Delete
[189] Fix | Delete
/**
[190] Fix | Delete
* Fires before a template part is loaded.
[191] Fix | Delete
*
[192] Fix | Delete
* @since 5.2.0
[193] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[194] Fix | Delete
*
[195] Fix | Delete
* @param string $slug The slug name for the generic template.
[196] Fix | Delete
* @param string $name The name of the specialized template.
[197] Fix | Delete
* @param string[] $templates Array of template files to search for, in order.
[198] Fix | Delete
* @param array $args Additional arguments passed to the template.
[199] Fix | Delete
*/
[200] Fix | Delete
do_action( 'get_template_part', $slug, $name, $templates, $args );
[201] Fix | Delete
[202] Fix | Delete
if ( ! locate_template( $templates, true, false, $args ) ) {
[203] Fix | Delete
return false;
[204] Fix | Delete
}
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
/**
[208] Fix | Delete
* Display search form.
[209] Fix | Delete
*
[210] Fix | Delete
* Will first attempt to locate the searchform.php file in either the child or
[211] Fix | Delete
* the parent, then load it. If it doesn't exist, then the default search form
[212] Fix | Delete
* will be displayed. The default search form is HTML, which will be displayed.
[213] Fix | Delete
* There is a filter applied to the search form HTML in order to edit or replace
[214] Fix | Delete
* it. The filter is {@see 'get_search_form'}.
[215] Fix | Delete
*
[216] Fix | Delete
* This function is primarily used by themes which want to hardcode the search
[217] Fix | Delete
* form into the sidebar and also by the search widget in WordPress.
[218] Fix | Delete
*
[219] Fix | Delete
* There is also an action that is called whenever the function is run called,
[220] Fix | Delete
* {@see 'pre_get_search_form'}. This can be useful for outputting JavaScript that the
[221] Fix | Delete
* search relies on or various formatting that applies to the beginning of the
[222] Fix | Delete
* search. To give a few examples of what it can be used for.
[223] Fix | Delete
*
[224] Fix | Delete
* @since 2.7.0
[225] Fix | Delete
* @since 5.2.0 The `$args` array parameter was added in place of an `$echo` boolean flag.
[226] Fix | Delete
*
[227] Fix | Delete
* @param array $args {
[228] Fix | Delete
* Optional. Array of display arguments.
[229] Fix | Delete
*
[230] Fix | Delete
* @type bool $echo Whether to echo or return the form. Default true.
[231] Fix | Delete
* @type string $aria_label ARIA label for the search form. Useful to distinguish
[232] Fix | Delete
* multiple search forms on the same page and improve
[233] Fix | Delete
* accessibility. Default empty.
[234] Fix | Delete
* }
[235] Fix | Delete
* @return void|string Void if 'echo' argument is true, search form HTML if 'echo' is false.
[236] Fix | Delete
*/
[237] Fix | Delete
function get_search_form( $args = array() ) {
[238] Fix | Delete
/**
[239] Fix | Delete
* Fires before the search form is retrieved, at the start of get_search_form().
[240] Fix | Delete
*
[241] Fix | Delete
* @since 2.7.0 as 'get_search_form' action.
[242] Fix | Delete
* @since 3.6.0
[243] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[244] Fix | Delete
*
[245] Fix | Delete
* @link https://core.trac.wordpress.org/ticket/19321
[246] Fix | Delete
*
[247] Fix | Delete
* @param array $args The array of arguments for building the search form.
[248] Fix | Delete
* See get_search_form() for information on accepted arguments.
[249] Fix | Delete
*/
[250] Fix | Delete
do_action( 'pre_get_search_form', $args );
[251] Fix | Delete
[252] Fix | Delete
$echo = true;
[253] Fix | Delete
[254] Fix | Delete
if ( ! is_array( $args ) ) {
[255] Fix | Delete
/*
[256] Fix | Delete
* Back compat: to ensure previous uses of get_search_form() continue to
[257] Fix | Delete
* function as expected, we handle a value for the boolean $echo param removed
[258] Fix | Delete
* in 5.2.0. Then we deal with the $args array and cast its defaults.
[259] Fix | Delete
*/
[260] Fix | Delete
$echo = (bool) $args;
[261] Fix | Delete
[262] Fix | Delete
// Set an empty array and allow default arguments to take over.
[263] Fix | Delete
$args = array();
[264] Fix | Delete
}
[265] Fix | Delete
[266] Fix | Delete
// Defaults are to echo and to output no custom label on the form.
[267] Fix | Delete
$defaults = array(
[268] Fix | Delete
'echo' => $echo,
[269] Fix | Delete
'aria_label' => '',
[270] Fix | Delete
);
[271] Fix | Delete
[272] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[273] Fix | Delete
[274] Fix | Delete
/**
[275] Fix | Delete
* Filters the array of arguments used when generating the search form.
[276] Fix | Delete
*
[277] Fix | Delete
* @since 5.2.0
[278] Fix | Delete
*
[279] Fix | Delete
* @param array $args The array of arguments for building the search form.
[280] Fix | Delete
* See get_search_form() for information on accepted arguments.
[281] Fix | Delete
*/
[282] Fix | Delete
$args = apply_filters( 'search_form_args', $args );
[283] Fix | Delete
[284] Fix | Delete
// Ensure that the filtered arguments contain all required default values.
[285] Fix | Delete
$args = array_merge( $defaults, $args );
[286] Fix | Delete
[287] Fix | Delete
$format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
[288] Fix | Delete
[289] Fix | Delete
/**
[290] Fix | Delete
* Filters the HTML format of the search form.
[291] Fix | Delete
*
[292] Fix | Delete
* @since 3.6.0
[293] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[294] Fix | Delete
*
[295] Fix | Delete
* @param string $format The type of markup to use in the search form.
[296] Fix | Delete
* Accepts 'html5', 'xhtml'.
[297] Fix | Delete
* @param array $args The array of arguments for building the search form.
[298] Fix | Delete
* See get_search_form() for information on accepted arguments.
[299] Fix | Delete
*/
[300] Fix | Delete
$format = apply_filters( 'search_form_format', $format, $args );
[301] Fix | Delete
[302] Fix | Delete
$search_form_template = locate_template( 'searchform.php' );
[303] Fix | Delete
[304] Fix | Delete
if ( '' !== $search_form_template ) {
[305] Fix | Delete
ob_start();
[306] Fix | Delete
require $search_form_template;
[307] Fix | Delete
$form = ob_get_clean();
[308] Fix | Delete
} else {
[309] Fix | Delete
// Build a string containing an aria-label to use for the search form.
[310] Fix | Delete
if ( $args['aria_label'] ) {
[311] Fix | Delete
$aria_label = 'aria-label="' . esc_attr( $args['aria_label'] ) . '" ';
[312] Fix | Delete
} else {
[313] Fix | Delete
/*
[314] Fix | Delete
* If there's no custom aria-label, we can set a default here. At the
[315] Fix | Delete
* moment it's empty as there's uncertainty about what the default should be.
[316] Fix | Delete
*/
[317] Fix | Delete
$aria_label = '';
[318] Fix | Delete
}
[319] Fix | Delete
[320] Fix | Delete
if ( 'html5' === $format ) {
[321] Fix | Delete
$form = '<form role="search" ' . $aria_label . 'method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
[322] Fix | Delete
<label>
[323] Fix | Delete
<span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
[324] Fix | Delete
<input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" />
[325] Fix | Delete
</label>
[326] Fix | Delete
<input type="submit" class="search-submit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
[327] Fix | Delete
</form>';
[328] Fix | Delete
} else {
[329] Fix | Delete
$form = '<form role="search" ' . $aria_label . 'method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
[330] Fix | Delete
<div>
[331] Fix | Delete
<label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
[332] Fix | Delete
<input type="text" value="' . get_search_query() . '" name="s" id="s" />
[333] Fix | Delete
<input type="submit" id="searchsubmit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" />
[334] Fix | Delete
</div>
[335] Fix | Delete
</form>';
[336] Fix | Delete
}
[337] Fix | Delete
}
[338] Fix | Delete
[339] Fix | Delete
/**
[340] Fix | Delete
* Filters the HTML output of the search form.
[341] Fix | Delete
*
[342] Fix | Delete
* @since 2.7.0
[343] Fix | Delete
* @since 5.5.0 The `$args` parameter was added.
[344] Fix | Delete
*
[345] Fix | Delete
* @param string $form The search form HTML output.
[346] Fix | Delete
* @param array $args The array of arguments for building the search form.
[347] Fix | Delete
* See get_search_form() for information on accepted arguments.
[348] Fix | Delete
*/
[349] Fix | Delete
$result = apply_filters( 'get_search_form', $form, $args );
[350] Fix | Delete
[351] Fix | Delete
if ( null === $result ) {
[352] Fix | Delete
$result = $form;
[353] Fix | Delete
}
[354] Fix | Delete
[355] Fix | Delete
if ( $args['echo'] ) {
[356] Fix | Delete
echo $result;
[357] Fix | Delete
} else {
[358] Fix | Delete
return $result;
[359] Fix | Delete
}
[360] Fix | Delete
}
[361] Fix | Delete
[362] Fix | Delete
/**
[363] Fix | Delete
* Display the Log In/Out link.
[364] Fix | Delete
*
[365] Fix | Delete
* Displays a link, which allows users to navigate to the Log In page to log in
[366] Fix | Delete
* or log out depending on whether they are currently logged in.
[367] Fix | Delete
*
[368] Fix | Delete
* @since 1.5.0
[369] Fix | Delete
*
[370] Fix | Delete
* @param string $redirect Optional path to redirect to on login/logout.
[371] Fix | Delete
* @param bool $echo Default to echo and not return the link.
[372] Fix | Delete
* @return void|string Void if `$echo` argument is true, log in/out link if `$echo` is false.
[373] Fix | Delete
*/
[374] Fix | Delete
function wp_loginout( $redirect = '', $echo = true ) {
[375] Fix | Delete
if ( ! is_user_logged_in() ) {
[376] Fix | Delete
$link = '<a href="' . esc_url( wp_login_url( $redirect ) ) . '">' . __( 'Log in' ) . '</a>';
[377] Fix | Delete
} else {
[378] Fix | Delete
$link = '<a href="' . esc_url( wp_logout_url( $redirect ) ) . '">' . __( 'Log out' ) . '</a>';
[379] Fix | Delete
}
[380] Fix | Delete
[381] Fix | Delete
if ( $echo ) {
[382] Fix | Delete
/**
[383] Fix | Delete
* Filters the HTML output for the Log In/Log Out link.
[384] Fix | Delete
*
[385] Fix | Delete
* @since 1.5.0
[386] Fix | Delete
*
[387] Fix | Delete
* @param string $link The HTML link content.
[388] Fix | Delete
*/
[389] Fix | Delete
echo apply_filters( 'loginout', $link );
[390] Fix | Delete
} else {
[391] Fix | Delete
/** This filter is documented in wp-includes/general-template.php */
[392] Fix | Delete
return apply_filters( 'loginout', $link );
[393] Fix | Delete
}
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
/**
[397] Fix | Delete
* Retrieves the logout URL.
[398] Fix | Delete
*
[399] Fix | Delete
* Returns the URL that allows the user to log out of the site.
[400] Fix | Delete
*
[401] Fix | Delete
* @since 2.7.0
[402] Fix | Delete
*
[403] Fix | Delete
* @param string $redirect Path to redirect to on logout.
[404] Fix | Delete
* @return string The logout URL. Note: HTML-encoded via esc_html() in wp_nonce_url().
[405] Fix | Delete
*/
[406] Fix | Delete
function wp_logout_url( $redirect = '' ) {
[407] Fix | Delete
$args = array();
[408] Fix | Delete
if ( ! empty( $redirect ) ) {
[409] Fix | Delete
$args['redirect_to'] = urlencode( $redirect );
[410] Fix | Delete
}
[411] Fix | Delete
[412] Fix | Delete
$logout_url = add_query_arg( $args, site_url( 'wp-login.php?action=logout', 'login' ) );
[413] Fix | Delete
$logout_url = wp_nonce_url( $logout_url, 'log-out' );
[414] Fix | Delete
[415] Fix | Delete
/**
[416] Fix | Delete
* Filters the logout URL.
[417] Fix | Delete
*
[418] Fix | Delete
* @since 2.8.0
[419] Fix | Delete
*
[420] Fix | Delete
* @param string $logout_url The HTML-encoded logout URL.
[421] Fix | Delete
* @param string $redirect Path to redirect to on logout.
[422] Fix | Delete
*/
[423] Fix | Delete
return apply_filters( 'logout_url', $logout_url, $redirect );
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* Retrieves the login URL.
[428] Fix | Delete
*
[429] Fix | Delete
* @since 2.7.0
[430] Fix | Delete
*
[431] Fix | Delete
* @param string $redirect Path to redirect to on log in.
[432] Fix | Delete
* @param bool $force_reauth Whether to force reauthorization, even if a cookie is present.
[433] Fix | Delete
* Default false.
[434] Fix | Delete
* @return string The login URL. Not HTML-encoded.
[435] Fix | Delete
*/
[436] Fix | Delete
function wp_login_url( $redirect = '', $force_reauth = false ) {
[437] Fix | Delete
$login_url = site_url( 'wp-login.php', 'login' );
[438] Fix | Delete
[439] Fix | Delete
if ( ! empty( $redirect ) ) {
[440] Fix | Delete
$login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );
[441] Fix | Delete
}
[442] Fix | Delete
[443] Fix | Delete
if ( $force_reauth ) {
[444] Fix | Delete
$login_url = add_query_arg( 'reauth', '1', $login_url );
[445] Fix | Delete
}
[446] Fix | Delete
[447] Fix | Delete
/**
[448] Fix | Delete
* Filters the login URL.
[449] Fix | Delete
*
[450] Fix | Delete
* @since 2.8.0
[451] Fix | Delete
* @since 4.2.0 The `$force_reauth` parameter was added.
[452] Fix | Delete
*
[453] Fix | Delete
* @param string $login_url The login URL. Not HTML-encoded.
[454] Fix | Delete
* @param string $redirect The path to redirect to on login, if supplied.
[455] Fix | Delete
* @param bool $force_reauth Whether to force reauthorization, even if a cookie is present.
[456] Fix | Delete
*/
[457] Fix | Delete
return apply_filters( 'login_url', $login_url, $redirect, $force_reauth );
[458] Fix | Delete
}
[459] Fix | Delete
[460] Fix | Delete
/**
[461] Fix | Delete
* Returns the URL that allows the user to register on the site.
[462] Fix | Delete
*
[463] Fix | Delete
* @since 3.6.0
[464] Fix | Delete
*
[465] Fix | Delete
* @return string User registration URL.
[466] Fix | Delete
*/
[467] Fix | Delete
function wp_registration_url() {
[468] Fix | Delete
/**
[469] Fix | Delete
* Filters the user registration URL.
[470] Fix | Delete
*
[471] Fix | Delete
* @since 3.6.0
[472] Fix | Delete
*
[473] Fix | Delete
* @param string $register The user registration URL.
[474] Fix | Delete
*/
[475] Fix | Delete
return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
[476] Fix | Delete
}
[477] Fix | Delete
[478] Fix | Delete
/**
[479] Fix | Delete
* Provides a simple login form for use anywhere within WordPress.
[480] Fix | Delete
*
[481] Fix | Delete
* The login form HTML is echoed by default. Pass a false value for `$echo` to return it instead.
[482] Fix | Delete
*
[483] Fix | Delete
* @since 3.0.0
[484] Fix | Delete
*
[485] Fix | Delete
* @param array $args {
[486] Fix | Delete
* Optional. Array of options to control the form output. Default empty array.
[487] Fix | Delete
*
[488] Fix | Delete
* @type bool $echo Whether to display the login form or return the form HTML code.
[489] Fix | Delete
* Default true (echo).
[490] Fix | Delete
* @type string $redirect URL to redirect to. Must be absolute, as in "https://example.com/mypage/".
[491] Fix | Delete
* Default is to redirect back to the request URI.
[492] Fix | Delete
* @type string $form_id ID attribute value for the form. Default 'loginform'.
[493] Fix | Delete
* @type string $label_username Label for the username or email address field. Default 'Username or Email Address'.
[494] Fix | Delete
* @type string $label_password Label for the password field. Default 'Password'.
[495] Fix | Delete
* @type string $label_remember Label for the remember field. Default 'Remember Me'.
[496] Fix | Delete
* @type string $label_log_in Label for the submit button. Default 'Log In'.
[497] Fix | Delete
* @type string $id_username ID attribute value for the username field. Default 'user_login'.
[498] Fix | Delete
* @type string $id_password ID attribute value for the password field. Default 'user_pass'.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function