Changeset 61009 for trunk/src/wp-includes/blocks/loginout.php
- Timestamp:
- 10/21/2025 07:11:53 AM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks/loginout.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/loginout.php
r58187 r61009 17 17 function render_block_core_loginout( $attributes ) { 18 18 19 // Build the redirect URL. 19 /* 20 * Build the redirect URL. This current url fetching logic matches with the core. 21 * 22 * @see https://github.com/WordPress/wordpress-develop/blob/6bf62e58d21739938f3bb3f9e16ba702baf9c2cc/src/wp-includes/general-template.php#L528. 23 */ 20 24 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 21 25 22 $classes = is_user_logged_in() ? 'logged-in' : 'logged-out'; 26 $user_logged_in = is_user_logged_in(); 27 28 $classes = $user_logged_in ? 'logged-in' : 'logged-out'; 23 29 $contents = wp_loginout( 24 30 isset( $attributes['redirectToCurrent'] ) && $attributes['redirectToCurrent'] ? $current_url : '', … … 27 33 28 34 // If logged-out and displayLoginAsForm is true, show the login form. 29 if ( ! is_user_logged_in()&& ! empty( $attributes['displayLoginAsForm'] ) ) {35 if ( ! $user_logged_in && ! empty( $attributes['displayLoginAsForm'] ) ) { 30 36 // Add a class. 31 37 $classes .= ' has-login-form';
Note: See TracChangeset
for help on using the changeset viewer.