Priority File Manager
📁 public_html
Base Directory:
/home/ecedu/public_html
/home/ecedu/public_html/wp-content/plugins
/home/ecedu/public_html/wp-content
/home/ecedu
/var/www
/var/www/cgi-bin
/var/www/html
public_html
/
wp-includes
/
blocks
/home/ecedu/public_html/wp-includes/blocks
Name
Type
Size
Actions
📁
..
Folder
-
Delete
Rename
📁
archives
Folder
-
Delete
Rename
📄
archives.php
File
2994
Delete
Rename
Edit
Download
📁
audio
Folder
-
Delete
Rename
📁
avatar
Folder
-
Delete
Rename
📄
avatar.php
File
5745
Delete
Rename
Edit
Download
📁
block
Folder
-
Delete
Rename
📄
block.php
File
3314
Delete
Rename
Edit
Download
📄
blocks-json.php
File
193945
Delete
Rename
Edit
Download
📁
button
Folder
-
Delete
Rename
📄
button.php
File
1805
Delete
Rename
Edit
Download
📁
buttons
Folder
-
Delete
Rename
📁
calendar
Folder
-
Delete
Rename
📄
calendar.php
File
6075
Delete
Rename
Edit
Download
📁
categories
Folder
-
Delete
Rename
📄
categories.php
File
4010
Delete
Rename
Edit
Download
📁
code
Folder
-
Delete
Rename
📁
column
Folder
-
Delete
Rename
📁
columns
Folder
-
Delete
Rename
📁
comment-author-name
Folder
-
Delete
Rename
📄
comment-author-name.php
File
2133
Delete
Rename
Edit
Download
📁
comment-content
Folder
-
Delete
Rename
📄
comment-content.php
File
2459
Delete
Rename
Edit
Download
📁
comment-date
Folder
-
Delete
Rename
📄
comment-date.php
File
1863
Delete
Rename
Edit
Download
📁
comment-edit-link
Folder
-
Delete
Rename
📄
comment-edit-link.php
File
1713
Delete
Rename
Edit
Download
📁
comment-reply-link
Folder
-
Delete
Rename
📄
comment-reply-link.php
File
2075
Delete
Rename
Edit
Download
📁
comment-template
Folder
-
Delete
Rename
📄
comment-template.php
File
4494
Delete
Rename
Edit
Download
📁
comments
Folder
-
Delete
Rename
📁
comments-pagination
Folder
-
Delete
Rename
📁
comments-pagination-next
Folder
-
Delete
Rename
📄
comments-pagination-next.php
File
1924
Delete
Rename
Edit
Download
📁
comments-pagination-numbers
Folder
-
Delete
Rename
📄
comments-pagination-numbers.php
File
1632
Delete
Rename
Edit
Download
📁
comments-pagination-previous
Folder
-
Delete
Rename
📄
comments-pagination-previous.php
File
1790
Delete
Rename
Edit
Download
📄
comments-pagination.php
File
1199
Delete
Rename
Edit
Download
📁
comments-title
Folder
-
Delete
Rename
📄
comments-title.php
File
2772
Delete
Rename
Edit
Download
📄
comments.php
File
6767
Delete
Rename
Edit
Download
📁
cover
Folder
-
Delete
Rename
📄
cover.php
File
3175
Delete
Rename
Edit
Download
📁
details
Folder
-
Delete
Rename
📁
embed
Folder
-
Delete
Rename
📁
file
Folder
-
Delete
Rename
📄
file.php
File
1793
Delete
Rename
Edit
Download
📁
footnotes
Folder
-
Delete
Rename
📄
footnotes.php
File
3771
Delete
Rename
Edit
Download
📁
freeform
Folder
-
Delete
Rename
📁
gallery
Folder
-
Delete
Rename
📄
gallery.php
File
6438
Delete
Rename
Edit
Download
📁
group
Folder
-
Delete
Rename
📁
heading
Folder
-
Delete
Rename
📄
heading.php
File
1301
Delete
Rename
Edit
Download
📁
home-link
Folder
-
Delete
Rename
📄
home-link.php
File
5438
Delete
Rename
Edit
Download
📁
html
Folder
-
Delete
Rename
📁
image
Folder
-
Delete
Rename
📄
image.php
File
12023
Delete
Rename
Edit
Download
📄
index.php
File
5111
Delete
Rename
Edit
Download
📁
latest-comments
Folder
-
Delete
Rename
📄
latest-comments.php
File
5040
Delete
Rename
Edit
Download
📁
latest-posts
Folder
-
Delete
Rename
📄
latest-posts.php
File
8542
Delete
Rename
Edit
Download
📁
legacy-widget
Folder
-
Delete
Rename
📄
legacy-widget.php
File
3997
Delete
Rename
Edit
Download
📁
list
Folder
-
Delete
Rename
📁
list-item
Folder
-
Delete
Rename
📄
list.php
File
1273
Delete
Rename
Edit
Download
📁
loginout
Folder
-
Delete
Rename
📄
loginout.php
File
1418
Delete
Rename
Edit
Download
📁
media-text
Folder
-
Delete
Rename
📄
media-text.php
File
4383
Delete
Rename
Edit
Download
📁
missing
Folder
-
Delete
Rename
📁
more
Folder
-
Delete
Rename
📁
navigation
Folder
-
Delete
Rename
📁
navigation-link
Folder
-
Delete
Rename
📄
navigation-link.php
File
13913
Delete
Rename
Edit
Download
📁
navigation-submenu
Folder
-
Delete
Rename
📄
navigation-submenu.php
File
9943
Delete
Rename
Edit
Download
📄
navigation.php
File
49620
Delete
Rename
Edit
Download
📁
nextpage
Folder
-
Delete
Rename
📁
page-list
Folder
-
Delete
Rename
📁
page-list-item
Folder
-
Delete
Rename
📄
page-list-item.php
File
361
Delete
Rename
Edit
Download
📄
page-list.php
File
13611
Delete
Rename
Edit
Download
📁
paragraph
Folder
-
Delete
Rename
📁
pattern
Folder
-
Delete
Rename
📄
pattern.php
File
1788
Delete
Rename
Edit
Download
📁
post-author
Folder
-
Delete
Rename
📁
post-author-biography
Folder
-
Delete
Rename
📄
post-author-biography.php
File
1524
Delete
Rename
Edit
Download
📁
post-author-name
Folder
-
Delete
Rename
📄
post-author-name.php
File
1951
Delete
Rename
Edit
Download
📄
post-author.php
File
2734
Delete
Rename
Edit
Download
📁
post-comments-form
Folder
-
Delete
Rename
📄
post-comments-form.php
File
2805
Delete
Rename
Edit
Download
📁
post-content
Folder
-
Delete
Rename
📄
post-content.php
File
2156
Delete
Rename
Edit
Download
📁
post-date
Folder
-
Delete
Rename
📄
post-date.php
File
3124
Delete
Rename
Edit
Download
📁
post-excerpt
Folder
-
Delete
Rename
📄
post-excerpt.php
File
3447
Delete
Rename
Edit
Download
📁
post-featured-image
Folder
-
Delete
Rename
📄
post-featured-image.php
File
9363
Delete
Rename
Edit
Download
📁
post-navigation-link
Folder
-
Delete
Rename
📄
post-navigation-link.php
File
4837
Delete
Rename
Edit
Download
📁
post-template
Folder
-
Delete
Rename
📄
post-template.php
File
5749
Delete
Rename
Edit
Download
📁
post-terms
Folder
-
Delete
Rename
📄
post-terms.php
File
3640
Delete
Rename
Edit
Download
📁
post-title
Folder
-
Delete
Rename
📄
post-title.php
File
2138
Delete
Rename
Edit
Download
📁
preformatted
Folder
-
Delete
Rename
📁
pullquote
Folder
-
Delete
Rename
📁
query
Folder
-
Delete
Rename
📁
query-no-results
Folder
-
Delete
Rename
📄
query-no-results.php
File
1847
Delete
Rename
Edit
Download
📁
query-pagination
Folder
-
Delete
Rename
📁
query-pagination-next
Folder
-
Delete
Rename
📄
query-pagination-next.php
File
3787
Delete
Rename
Edit
Download
📁
query-pagination-numbers
Folder
-
Delete
Rename
📄
query-pagination-numbers.php
File
4770
Delete
Rename
Edit
Download
📁
query-pagination-previous
Folder
-
Delete
Rename
📄
query-pagination-previous.php
File
3584
Delete
Rename
Edit
Download
📄
query-pagination.php
File
1176
Delete
Rename
Edit
Download
📁
query-title
Folder
-
Delete
Rename
📄
query-title.php
File
2098
Delete
Rename
Edit
Download
📁
query-total
Folder
-
Delete
Rename
📄
query-total.php
File
2535
Delete
Rename
Edit
Download
📄
query.php
File
5690
Delete
Rename
Edit
Download
📁
quote
Folder
-
Delete
Rename
📁
read-more
Folder
-
Delete
Rename
📄
read-more.php
File
1830
Delete
Rename
Edit
Download
📄
require-dynamic-blocks.php
File
4163
Delete
Rename
Edit
Download
📄
require-static-blocks.php
File
501
Delete
Rename
Edit
Download
📁
rss
Folder
-
Delete
Rename
📄
rss.php
File
4073
Delete
Rename
Edit
Download
📁
search
Folder
-
Delete
Rename
📄
search.php
File
23016
Delete
Rename
Edit
Download
📁
separator
Folder
-
Delete
Rename
📁
shortcode
Folder
-
Delete
Rename
📄
shortcode.php
File
735
Delete
Rename
Edit
Download
📁
site-logo
Folder
-
Delete
Rename
📄
site-logo.php
File
6334
Delete
Rename
Edit
Download
📁
site-tagline
Folder
-
Delete
Rename
📄
site-tagline.php
File
1203
Delete
Rename
Edit
Download
📁
site-title
Folder
-
Delete
Rename
📄
site-title.php
File
1853
Delete
Rename
Edit
Download
📁
social-link
Folder
-
Delete
Rename
📄
social-link.php
File
65174
Delete
Rename
Edit
Download
📁
social-links
Folder
-
Delete
Rename
📁
spacer
Folder
-
Delete
Rename
📁
table
Folder
-
Delete
Rename
📁
tag-cloud
Folder
-
Delete
Rename
📄
tag-cloud.php
File
1590
Delete
Rename
Edit
Download
📁
template-part
Folder
-
Delete
Rename
📄
template-part.php
File
10154
Delete
Rename
Edit
Download
📁
term-description
Folder
-
Delete
Rename
📄
term-description.php
File
1336
Delete
Rename
Edit
Download
📁
text-columns
Folder
-
Delete
Rename
📁
verse
Folder
-
Delete
Rename
📁
video
Folder
-
Delete
Rename
📁
widget-group
Folder
-
Delete
Rename
📄
widget-group.php
File
2438
Delete
Rename
Edit
Download
Upload
Create Folder
📝 Editing:
calendar.php
Size: 6,075 bytes
Lines: 190
Type: .php
💾 Save
Cancel
✕
<?php /** * Server-side rendering of the `core/calendar` block. * * @package WordPress */ /** * Renders the `core/calendar` block on server. * * @since 5.2.0 * * @global int $monthnum. * @global int $year. * * @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. * * @since 5.2.0 */ 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 * * @since 5.9.0 * * @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. * * @since 5.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @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. * * @since 5.9.0 * * @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. * * @since 5.9.0 * * @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 ); }
✅ File saved successfully!