GRAYBYTE WORDPRESS FILE MANAGER5333

Server IP : 68.65.123.43 / Your IP : 216.73.216.162
System : Linux server266.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/inteuuod/ai.internsifyafrica.com/wp-includes/blocks/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/inteuuod/ai.internsifyafrica.com/wp-includes/blocks//calendar.php
<?php
/**
 * Server-side rendering of the `core/calendar` block.
 *
 * @package WordPress
 */

/**
 * Renders the `core/calendar` block on server.
 *
 * @param array $attributes The block attributes.
 *
 * @return string Returns the block content.
 */
function render_block_core_calendar( $attributes ) {
	global $monthnum, $year;

	// Calendar shouldn't be rendered
	// when there are no published posts on the site.
	if ( ! block_core_calendar_has_published_posts() ) {
		if ( is_user_logged_in() ) {
			return '<div>' . __( 'The calendar block is hidden because there are no published posts.' ) . '</div>';
		}
		return '';
	}

	$previous_monthnum = $monthnum;
	$previous_year     = $year;

	if ( isset( $attributes['month'] ) && isset( $attributes['year'] ) ) {
		$permalink_structure = get_option( 'permalink_structure' );
		if (
			str_contains( $permalink_structure, '%monthnum%' ) &&
			str_contains( $permalink_structure, '%year%' )
		) {
			$monthnum = $attributes['month'];
			$year     = $attributes['year'];
		}
	}

	$color_block_styles = array();

	// Text color.
	$preset_text_color          = array_key_exists( 'textColor', $attributes ) ? "var:preset|color|{$attributes['textColor']}" : null;
	$custom_text_color          = $attributes['style']['color']['text'] ?? null;
	$color_block_styles['text'] = $preset_text_color ? $preset_text_color : $custom_text_color;

	// Background Color.
	$preset_background_color          = array_key_exists( 'backgroundColor', $attributes ) ? "var:preset|color|{$attributes['backgroundColor']}" : null;
	$custom_background_color          = $attributes['style']['color']['background'] ?? null;
	$color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color;

	// Generate color styles and classes.
	$styles        = wp_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) );
	$inline_styles = empty( $styles['css'] ) ? '' : sprintf( ' style="%s"', esc_attr( $styles['css'] ) );
	$classnames    = empty( $styles['classnames'] ) ? '' : ' ' . esc_attr( $styles['classnames'] );
	if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
		$classnames .= ' has-link-color';
	}
	// Apply color classes and styles to the calendar.
	$calendar = str_replace( '<table', '<table' . $inline_styles, get_calendar( true, false ) );
	$calendar = str_replace( 'class="wp-calendar-table', 'class="wp-calendar-table' . $classnames, $calendar );

	$wrapper_attributes = get_block_wrapper_attributes();
	$output             = sprintf(
		'<div %1$s>%2$s</div>',
		$wrapper_attributes,
		$calendar
	);

	$monthnum = $previous_monthnum;
	$year     = $previous_year;

	return $output;
}

/**
 * Registers the `core/calendar` block on server.
 */
function register_block_core_calendar() {
	register_block_type_from_metadata(
		__DIR__ . '/calendar',
		array(
			'render_callback' => 'render_block_core_calendar',
		)
	);
}

add_action( 'init', 'register_block_core_calendar' );

/**
 * Returns whether or not there are any published posts.
 *
 * Used to hide the calendar block when there are no published posts.
 * This compensates for a known Core bug: https://core.trac.wordpress.org/ticket/12016
 *
 * @return bool Has any published posts or not.
 */
function block_core_calendar_has_published_posts() {
	// Multisite already has an option that stores the count of the published posts.
	// Let's use that for multisites.
	if ( is_multisite() ) {
		return 0 < (int) get_option( 'post_count' );
	}

	// On single sites we try our own cached option first.
	$has_published_posts = get_option( 'wp_calendar_block_has_published_posts', null );
	if ( null !== $has_published_posts ) {
		return (bool) $has_published_posts;
	}

	// No cache hit, let's update the cache and return the cached value.
	return block_core_calendar_update_has_published_posts();
}

/**
 * Queries the database for any published post and saves
 * a flag whether any published post exists or not.
 *
 * @return bool Has any published posts or not.
 */
function block_core_calendar_update_has_published_posts() {
	global $wpdb;
	$has_published_posts = (bool) $wpdb->get_var( "SELECT 1 as test FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' LIMIT 1" );
	update_option( 'wp_calendar_block_has_published_posts', $has_published_posts );
	return $has_published_posts;
}

// We only want to register these functions and actions when
// we are on single sites. On multi sites we use `post_count` option.
if ( ! is_multisite() ) {
	/**
	 * Handler for updating the has published posts flag when a post is deleted.
	 *
	 * @param int $post_id Deleted post ID.
	 */
	function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
		$post = get_post( $post_id );

		if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
			return;
		}

		block_core_calendar_update_has_published_posts();
	}

	/**
	 * Handler for updating the has published posts flag when a post status changes.
	 *
	 * @param string  $new_status The status the post is changing to.
	 * @param string  $old_status The status the post is changing from.
	 * @param WP_Post $post       Post object.
	 */
	function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {
		if ( $new_status === $old_status ) {
			return;
		}

		if ( 'post' !== get_post_type( $post ) ) {
			return;
		}

		if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
			return;
		}

		block_core_calendar_update_has_published_posts();
	}

	add_action( 'delete_post', 'block_core_calendar_update_has_published_post_on_delete' );
	add_action( 'transition_post_status', 'block_core_calendar_update_has_published_post_on_transition_post_status', 10, 3 );
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 13 2025 02:32:20
inteuuod / inteuuod
0755
archives
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
audio
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
avatar
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
block
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
button
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
buttons
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
calendar
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
categories
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
code
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
column
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
columns
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comment-author-name
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comment-content
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comment-date
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comment-edit-link
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comment-reply-link
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comment-template
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comments
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comments-pagination
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comments-pagination-next
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comments-pagination-numbers
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comments-pagination-previous
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
comments-title
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
cover
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
details
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
embed
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
file
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
footnotes
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
freeform
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
gallery
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
group
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
heading
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
home-link
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
html
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
image
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
latest-comments
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
latest-posts
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
legacy-widget
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
list
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
list-item
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
loginout
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
media-text
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
missing
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
more
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
navigation
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
navigation-link
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
navigation-submenu
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
nextpage
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
page-list
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
page-list-item
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
paragraph
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
pattern
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-author
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-author-biography
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-author-name
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-comments-form
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-content
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-date
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-excerpt
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-featured-image
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-navigation-link
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-template
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-terms
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
post-title
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
preformatted
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
pullquote
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query-no-results
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query-pagination
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query-pagination-next
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query-pagination-numbers
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query-pagination-previous
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
query-title
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
quote
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
read-more
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
rss
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
search
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
separator
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
shortcode
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
site-logo
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
site-tagline
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
site-title
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
social-link
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
social-links
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
spacer
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
table
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
tag-cloud
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
template-part
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
term-description
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
text-columns
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
verse
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
video
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
widget-group
--
July 11 2025 00:52:32
inteuuod / inteuuod
0755
.htaccess
0.124 KB
July 11 2025 00:52:32
inteuuod / inteuuod
0444
archives.php
2.887 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
avatar.php
5.511 KB
April 09 2024 20:33:28
inteuuod / inteuuod
0644
block.php
2.993 KB
March 05 2024 00:38:24
inteuuod / inteuuod
0644
blocks-json.php
167.852 KB
February 20 2024 21:46:26
inteuuod / inteuuod
0644
calendar.php
5.705 KB
January 30 2024 07:37:12
inteuuod / inteuuod
0644
categories.php
2.811 KB
January 30 2024 07:37:12
inteuuod / inteuuod
0644
comment-author-name.php
2.046 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
comment-content.php
2.364 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
comment-date.php
1.559 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
comment-edit-link.php
1.636 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
comment-reply-link.php
1.989 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
comment-template.php
4.352 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
comments-pagination-next.php
1.811 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
comments-pagination-numbers.php
1.557 KB
April 13 2022 00:42:48
inteuuod / inteuuod
0644
comments-pagination-previous.php
1.607 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
comments-pagination.php
1.134 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
comments-title.php
2.67 KB
September 21 2022 01:13:30
inteuuod / inteuuod
0644
comments.php
6.469 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
cover.php
2.452 KB
June 28 2023 00:05:30
inteuuod / inteuuod
0644
file.php
2.405 KB
February 13 2024 23:42:18
inteuuod / inteuuod
0644
footnotes.php
3.683 KB
February 28 2024 01:18:24
inteuuod / inteuuod
0644
gallery.php
6.232 KB
February 10 2024 04:52:22
inteuuod / inteuuod
0644
heading.php
1.233 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
home-link.php
5.506 KB
February 10 2024 04:52:22
inteuuod / inteuuod
0644
image.php
10.536 KB
February 13 2024 23:42:18
inteuuod / inteuuod
0644
index.php
4.478 KB
October 30 2023 22:24:22
inteuuod / inteuuod
0644
latest-comments.php
4.885 KB
April 13 2022 00:42:48
inteuuod / inteuuod
0644
latest-posts.php
8.17 KB
October 10 2023 21:00:20
inteuuod / inteuuod
0644
legacy-widget.php
3.811 KB
October 18 2022 23:26:02
inteuuod / inteuuod
0644
loginout.php
1.348 KB
November 09 2021 00:59:22
inteuuod / inteuuod
0644
navigation-link.php
12.88 KB
February 20 2024 21:46:26
inteuuod / inteuuod
0644
navigation-submenu.php
8.814 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
navigation.php
57.238 KB
March 28 2024 18:01:20
inteuuod / inteuuod
0644
page-list-item.php
0.334 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
page-list.php
13.137 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
pattern.php
2.118 KB
January 31 2024 23:29:56
inteuuod / inteuuod
0644
post-author-biography.php
1.414 KB
April 13 2022 00:42:48
inteuuod / inteuuod
0644
post-author-name.php
1.705 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
post-author.php
2.507 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
post-comments-form.php
2.684 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
post-content.php
2.068 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
post-date.php
2.289 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
post-excerpt.php
3.329 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
post-featured-image.php
8.826 KB
January 30 2024 07:37:12
inteuuod / inteuuod
0644
post-navigation-link.php
4.687 KB
February 10 2024 04:52:22
inteuuod / inteuuod
0644
post-template.php
5.521 KB
March 06 2024 00:29:18
inteuuod / inteuuod
0644
post-terms.php
3.549 KB
February 10 2024 04:52:22
inteuuod / inteuuod
0644
post-title.php
2.029 KB
January 30 2024 07:37:12
inteuuod / inteuuod
0644
query-no-results.php
1.711 KB
September 26 2023 23:53:26
inteuuod / inteuuod
0644
query-pagination-next.php
3.6 KB
January 30 2024 07:37:12
inteuuod / inteuuod
0644
query-pagination-numbers.php
4.565 KB
February 13 2024 23:42:18
inteuuod / inteuuod
0644
query-pagination-previous.php
3.056 KB
January 30 2024 07:37:12
inteuuod / inteuuod
0644
query-pagination.php
1.111 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
query-title.php
2.012 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
query.php
6.147 KB
February 13 2024 23:42:18
inteuuod / inteuuod
0644
read-more.php
1.75 KB
February 07 2023 23:30:10
inteuuod / inteuuod
0644
require-dynamic-blocks.php
3.852 KB
November 01 2023 00:44:06
inteuuod / inteuuod
0644
require-static-blocks.php
0.523 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
rss.php
3.834 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
search.php
22.791 KB
March 05 2024 00:38:24
inteuuod / inteuuod
0644
shortcode.php
0.681 KB
June 26 2020 23:03:48
inteuuod / inteuuod
0644
site-logo.php
5.794 KB
June 27 2023 23:54:20
inteuuod / inteuuod
0644
site-tagline.php
0.971 KB
June 22 2021 19:30:50
inteuuod / inteuuod
0644
site-title.php
1.729 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
social-link.php
62.158 KB
February 10 2024 04:52:22
inteuuod / inteuuod
0644
tag-cloud.php
1.37 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
template-part.php
9.715 KB
June 25 2024 00:45:18
inteuuod / inteuuod
0644
term-description.php
1.268 KB
February 07 2023 17:34:52
inteuuod / inteuuod
0644
widget-group.php
2.115 KB
October 18 2022 23:26:02
inteuuod / inteuuod
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF