- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r23800 r24524 156 156 do_action( 'pre_get_search_form' ); 157 157 158 $format = apply_filters( 'search_form_format', 'xhtml' ); 158 $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml'; 159 $format = apply_filters( 'search_form_format', $format ); 159 160 160 161 $search_form_template = locate_template( 'searchform.php' ); … … 164 165 $form = ob_get_clean(); 165 166 } else { 166 $type = ( 'html5' === $format ) ? 'search' : 'text'; 167 $placeholder = ( 'html5' === $format ) ? 'placeholder="' . esc_attr_x( 'Search …', 'placeholder' ) . '" ' : ''; 168 169 $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> 170 <div> 171 <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label> 172 <input type="' . $type . '" ' . $placeholder . 'value="' . get_search_query() . '" name="s" id="s" /> 173 <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> 174 </div> 175 </form>'; 167 if ( 'html5' == $format ) { 168 $form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '"> 169 <label> 170 <span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span> 171 <input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search …', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . _x( 'Search for:', 'label' ) . '" /> 172 </label> 173 <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> 174 </form>'; 175 } else { 176 $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> 177 <div> 178 <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label> 179 <input type="text" value="' . get_search_query() . '" name="s" id="s" /> 180 <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> 181 </div> 182 </form>'; 183 } 176 184 } 177 185 … … 214 222 * Returns the Log Out URL. 215 223 * 216 * Returns the URL that allows the user to log out of the site 224 * Returns the URL that allows the user to log out of the site. 217 225 * 218 226 * @since 2.7.0 219 * @uses wp_nonce_url() To protect against CSRF 220 * @uses site_url() To generate the log in URL221 * @uses apply_filters() calls 'logout_url' hook on final logout url227 * @uses wp_nonce_url() To protect against CSRF. 228 * @uses site_url() To generate the log out URL. 229 * @uses apply_filters() calls 'logout_url' hook on final logout URL. 222 230 * 223 231 * @param string $redirect Path to redirect to on logout. … … 239 247 * Returns the Log In URL. 240 248 * 241 * Returns the URL that allows the user to log in to the site 249 * Returns the URL that allows the user to log in to the site. 242 250 * 243 251 * @since 2.7.0 244 * @uses site_url() To generate the log in URL 245 * @uses apply_filters() calls 'login_url' hook on final login url252 * @uses site_url() To generate the log in URL. 253 * @uses apply_filters() calls 'login_url' hook on final login URL. 246 254 * 247 255 * @param string $redirect Path to redirect to on login. … … 259 267 260 268 return apply_filters('login_url', $login_url, $redirect); 269 } 270 271 /** 272 * Returns the user registration URL. 273 * 274 * Returns the URL that allows the user to register on the site. 275 * 276 * @since 3.6.0 277 * @uses site_url() To generate the registration URL. 278 * @uses apply_filters() calls 'register_url' hook on final URL. 279 * 280 * @return string 281 */ 282 function wp_registration_url() { 283 return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) ); 261 284 } 262 285 … … 354 377 if ( ! is_user_logged_in() ) { 355 378 if ( get_option('users_can_register') ) 356 $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;379 $link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __('Register') . '</a>' . $after; 357 380 else 358 381 $link = ''; … … 1559 1582 */ 1560 1583 function the_weekday_date($before='',$after='') { 1561 global $wp_locale, $ day, $previousweekday;1584 global $wp_locale, $currentday, $previousweekday; 1562 1585 $the_weekday_date = ''; 1563 1586 if ( $currentday != $previousweekday ) { … … 2317 2340 */ 2318 2341 function wp_heartbeat_settings( $settings ) { 2342 if ( ! is_admin() ) 2343 $settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' ); 2344 2319 2345 if ( is_user_logged_in() ) 2320 2346 $settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );
Note: See TracChangeset
for help on using the changeset viewer.