Skip to content

Commit 72c922b

Browse files
SH4LINSH4LINt-hamanoMamaduka
authored
Add comment for redirect URL in 'Login/out' block (WordPress#70031)
Co-authored-by: SH4LIN <sh4lin@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
1 parent 7d3fafc commit 72c922b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/block-library/src/loginout/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
*/
1717
function render_block_core_loginout( $attributes ) {
1818

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+
*/
2024
$current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
2125

2226
$classes = is_user_logged_in() ? 'logged-in' : 'logged-out';

0 commit comments

Comments
 (0)