X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..607b7e02d77e7326161e8ec15639052d2040f745:/wp-includes/general-template.php diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index f554e1fd..12ffd4a9 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -36,14 +36,13 @@ function get_header( $name = null ) { $templates = array(); $name = (string) $name; - if ( '' !== $name ) + if ( '' !== $name ) { $templates[] = "header-{$name}.php"; + } $templates[] = 'header.php'; - // Backward compat code will be removed in a future release - if ('' == locate_template($templates, true)) - load_template( ABSPATH . WPINC . '/theme-compat/header.php'); + locate_template( $templates, true ); } /** @@ -76,14 +75,13 @@ function get_footer( $name = null ) { $templates = array(); $name = (string) $name; - if ( '' !== $name ) + if ( '' !== $name ) { $templates[] = "footer-{$name}.php"; + } - $templates[] = 'footer.php'; + $templates[] = 'footer.php'; - // Backward compat code will be removed in a future release - if ('' == locate_template($templates, true)) - load_template( ABSPATH . WPINC . '/theme-compat/footer.php'); + locate_template( $templates, true ); } /** @@ -121,9 +119,7 @@ function get_sidebar( $name = null ) { $templates[] = 'sidebar.php'; - // Backward compat code will be removed in a future release - if ('' == locate_template($templates, true)) - load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php'); + locate_template( $templates, true ); } /** @@ -178,13 +174,13 @@ function get_template_part( $slug, $name = null ) { * the parent, then load it. If it doesn't exist, then the default search form * will be displayed. The default search form is HTML, which will be displayed. * There is a filter applied to the search form HTML in order to edit or replace - * it. The filter is 'get_search_form'. + * it. The filter is {@see 'get_search_form'}. * * This function is primarily used by themes which want to hardcode the search * form into the sidebar and also by the search widget in WordPress. * * There is also an action that is called whenever the function is run called, - * 'pre_get_search_form'. This can be useful for outputting JavaScript that the + * {@see 'pre_get_search_form'}. This can be useful for outputting JavaScript that the * search relies on or various formatting that applies to the beginning of the * search. To give a few examples of what it can be used for. * @@ -207,7 +203,7 @@ function get_search_form( $echo = true ) { $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml'; /** - * Filter the HTML format of the search form. + * Filters the HTML format of the search form. * * @since 3.6.0 * @@ -226,7 +222,7 @@ function get_search_form( $echo = true ) { $form = '
'; @@ -242,7 +238,7 @@ function get_search_form( $echo = true ) { } /** - * Filter the HTML output of the search form. + * Filters the HTML output of the search form. * * @since 2.7.0 * @@ -279,7 +275,7 @@ function wp_loginout($redirect = '', $echo = true) { if ( $echo ) { /** - * Filter the HTML output for the Log In/Log Out link. + * Filters the HTML output for the Log In/Log Out link. * * @since 1.5.0 * @@ -293,14 +289,14 @@ function wp_loginout($redirect = '', $echo = true) { } /** - * Returns the Log Out URL. + * Retrieves the logout URL. * * Returns the URL that allows the user to log out of the site. * * @since 2.7.0 * * @param string $redirect Path to redirect to on logout. - * @return string A log out URL. + * @return string The logout URL. Note: HTML-encoded via esc_html() in wp_nonce_url(). */ function wp_logout_url($redirect = '') { $args = array( 'action' => 'logout' ); @@ -312,24 +308,25 @@ function wp_logout_url($redirect = '') { $logout_url = wp_nonce_url( $logout_url, 'log-out' ); /** - * Filter the logout URL. + * Filters the logout URL. * * @since 2.8.0 * - * @param string $logout_url The Log Out URL. + * @param string $logout_url The HTML-encoded logout URL. * @param string $redirect Path to redirect to on logout. */ return apply_filters( 'logout_url', $logout_url, $redirect ); } /** - * Returns the URL that allows the user to log in to the site. + * Retrieves the login URL. * * @since 2.7.0 * - * @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. + * @param string $redirect Path to redirect to on log in. + * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. + * Default false. + * @return string The login URL. Not HTML-encoded. */ function wp_login_url($redirect = '', $force_reauth = false) { $login_url = site_url('wp-login.php', 'login'); @@ -341,12 +338,12 @@ function wp_login_url($redirect = '', $force_reauth = false) { $login_url = add_query_arg('reauth', '1', $login_url); /** - * Filter the login URL. + * Filters the login URL. * * @since 2.8.0 * @since 4.2.0 The `$force_reauth` parameter was added. * - * @param string $login_url The login URL. + * @param string $login_url The login URL. Not HTML-encoded. * @param string $redirect The path to redirect to on login, if supplied. * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. */ @@ -362,7 +359,7 @@ function wp_login_url($redirect = '', $force_reauth = false) { */ function wp_registration_url() { /** - * Filter the user registration URL. + * Filters the user registration URL. * * @since 3.6.0 * @@ -386,7 +383,7 @@ function wp_registration_url() { * @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 field. Default 'Username'. + * @type string $label_username Label for the username or email address field. Default 'Username or Email'. * @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'. @@ -408,7 +405,7 @@ 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' ), + 'label_username' => __( 'Username or Email' ), 'label_password' => __( 'Password' ), 'label_remember' => __( 'Remember Me' ), 'label_log_in' => __( 'Log In' ), @@ -423,7 +420,7 @@ function wp_login_form( $args = array() ) { ); /** - * Filter the default login form output arguments. + * Filters the default login form output arguments. * * @since 3.0.0 * @@ -434,7 +431,7 @@ function wp_login_form( $args = array() ) { $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) ); /** - * Filter content to display at the top of the login form. + * Filters content to display at the top of the login form. * * The filter evaluates just following the opening form tag element. * @@ -446,7 +443,7 @@ function wp_login_form( $args = array() ) { $login_form_top = apply_filters( 'login_form_top', '', $args ); /** - * Filter content to display in the middle of the login form. + * Filters content to display in the middle of the login form. * * The filter evaluates just following the location where the 'login-password' * field is displayed. @@ -459,7 +456,7 @@ function wp_login_form( $args = array() ) { $login_form_middle = apply_filters( 'login_form_middle', '', $args ); /** - * Filter content to display at the bottom of the login form. + * Filters content to display at the bottom of the login form. * * The filter evaluates just preceding the closing form tag element. * @@ -471,7 +468,7 @@ function wp_login_form( $args = array() ) { $login_form_bottom = apply_filters( 'login_form_bottom', '', $args ); $form = ' -