PATH:
home
/
infinityocean
/
public_html
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/loginout` block. * * @package WordPress */ /** * Renders the `core/loginout` block on server. * * @since 5.8.0 * * @param array $attributes The block attributes. * * @return string Returns the login-out link or form. */ function render_block_core_loginout( $attributes ) { /* * Build the redirect URL. This current url fetching logic matches with the core. * * @see https://github.com/WordPress/wordpress-develop/blob/6bf62e58d21739938f3bb3f9e16ba702baf9c2cc/src/wp-includes/general-template.php#L528. */ $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $user_logged_in = is_user_logged_in(); $classes = $user_logged_in ? 'logged-in' : 'logged-out'; $contents = wp_loginout( isset( $attributes['redirectToCurrent'] ) && $attributes['redirectToCurrent'] ? $current_url : '', false ); // If logged-out and displayLoginAsForm is true, show the login form. if ( ! $user_logged_in && ! empty( $attributes['displayLoginAsForm'] ) ) { // Add a class. $classes .= ' has-login-form'; // Get the form. $contents = wp_login_form( array( 'echo' => false ) ); } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); return '<div ' . $wrapper_attributes . '>' . $contents . '</div>'; } /** * Registers the `core/loginout` block on server. * * @since 5.8.0 */ function register_block_core_loginout() { register_block_type_from_metadata( __DIR__ . '/loginout', array( 'render_callback' => 'render_block_core_loginout', ) ); } add_action( 'init', 'register_block_core_loginout' );
[+]
..
[+]
social-link
[+]
button
[+]
query-pagination-previous
[+]
media-text
[+]
term-name
[-] post-featured-image.php
[edit]
[+]
comments-title
[-] rss.php
[edit]
[+]
buttons
[-] accordion-item.php
[edit]
[-] post-date.php
[edit]
[+]
site-logo
[+]
pullquote
[+]
comment-date
[-] widget-group.php
[edit]
[+]
table
[+]
categories
[-] index.php
[edit]
[+]
video
[+]
widget-group
[+]
accordion-item
[+]
social-links
[-] comments-pagination-next.php
[edit]
[+]
rss
[-] navigation-link.php
[edit]
[-] cover.php
[edit]
[+]
pattern
[+]
site-title
[-] error_log
[edit]
[+]
quote
[-] template-part.php
[edit]
[-] post-title.php
[edit]
[+]
navigation
[+]
comments-pagination-numbers
[+]
html
[+]
comment-reply-link
[+]
home-link
[+]
avatar
[+]
cover
[-] post-author-biography.php
[edit]
[+]
list-item
[-] comment-content.php
[edit]
[+]
post-comments-form
[+]
query-pagination-next
[+]
navigation-submenu
[+]
shortcode
[-] image.php
[edit]
[+]
code
[+]
loginout
[+]
paragraph
[+]
legacy-widget
[+]
missing
[-] query-pagination.php
[edit]
[+]
site-tagline
[+]
details
[+]
post-terms
[-] navigation.php
[edit]
[+]
spacer
[+]
comment-template
[+]
comment-edit-link
[+]
columns
[+]
separator
[+]
comments
[+]
query-title
[+]
nextpage
[+]
query-no-results
[-] comment-edit-link.php
[edit]
[+]
group
[+]
preformatted
[+]
post-author
[+]
comments-pagination-previous
[-] calendar.php
[edit]
[+]
query-pagination
[+]
footnotes
[-] term-description.php
[edit]
[+]
post-author-name
[+]
read-more
[+]
archives
[+]
verse
[+]
calendar
[-] comments-pagination-numbers.php
[edit]
[+]
embed
[-] post-template.php
[edit]
[+]
comment-content
[+]
post-comments-link
[+]
heading
[-] page-list.php
[edit]
[-] post-comments-form.php
[edit]
[+]
post-comments-count
[+]
latest-comments
[+]
list
[+]
post-template
[+]
post-title
[+]
more
[+]
post-excerpt
[+]
page-list-item
[+]
column
[+]
math
[+]
file
[+]
latest-posts
[+]
post-time-to-read
[+]
query
[-] navigation-submenu.php
[edit]
[+]
term-description
[+]
term-template
[+]
comments-pagination
[-] pattern.php
[edit]
[-] accordion.php
[edit]
[+]
accordion-panel
[-] loginout.php
[edit]
[+]
gallery
[+]
page-list
[-] post-author.php
[edit]
[+]
query-total
[+]
tag-cloud
[+]
term-count
[+]
post-content
[-] tag-cloud.php
[edit]
[+]
search
[+]
template-part
[-] comment-date.php
[edit]
[+]
audio
[+]
text-columns
[+]
comments-pagination-next
[-] footnotes.php
[edit]
[+]
post-navigation-link
[+]
image
[+]
post-date
[+]
freeform
[+]
accordion-heading
[+]
block
[+]
post-author-biography
[+]
comment-author-name
[+]
post-featured-image
[+]
accordion
[+]
query-pagination-numbers
[+]
navigation-link
[+]
terms-query