home
/
aioutajg
/
8171bispupdate.com
/
wp-includes
/
blocks
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
[DIR] archives
N/A
[DIR] audio
N/A
[DIR] avatar
N/A
[DIR] block
N/A
[DIR] button
N/A
[DIR] buttons
N/A
[DIR] calendar
N/A
[DIR] categories
N/A
[DIR] code
N/A
[DIR] column
N/A
[DIR] columns
N/A
[DIR] comment-author-name
N/A
[DIR] comment-content
N/A
[DIR] comment-date
N/A
[DIR] comment-edit-link
N/A
[DIR] comment-reply-link
N/A
[DIR] comment-template
N/A
[DIR] comments
N/A
[DIR] comments-pagination
N/A
[DIR] comments-pagination-next
N/A
[DIR] comments-pagination-numbers
N/A
[DIR] comments-pagination-previous
N/A
[DIR] comments-title
N/A
[DIR] cover
N/A
[DIR] details
N/A
[DIR] embed
N/A
[DIR] file
N/A
[DIR] footnotes
N/A
[DIR] freeform
N/A
[DIR] gallery
N/A
[DIR] group
N/A
[DIR] heading
N/A
[DIR] home-link
N/A
[DIR] html
N/A
[DIR] image
N/A
[DIR] latest-comments
N/A
[DIR] latest-posts
N/A
[DIR] legacy-widget
N/A
[DIR] list
N/A
[DIR] list-item
N/A
[DIR] loginout
N/A
[DIR] media-text
N/A
[DIR] missing
N/A
[DIR] more
N/A
[DIR] navigation
N/A
[DIR] navigation-link
N/A
[DIR] navigation-submenu
N/A
[DIR] nextpage
N/A
[DIR] page-list
N/A
[DIR] page-list-item
N/A
[DIR] paragraph
N/A
[DIR] pattern
N/A
[DIR] post-author
N/A
[DIR] post-author-biography
N/A
[DIR] post-author-name
N/A
[DIR] post-comments-form
N/A
[DIR] post-content
N/A
[DIR] post-date
N/A
[DIR] post-excerpt
N/A
[DIR] post-featured-image
N/A
[DIR] post-navigation-link
N/A
[DIR] post-template
N/A
[DIR] post-terms
N/A
[DIR] post-title
N/A
[DIR] preformatted
N/A
[DIR] pullquote
N/A
[DIR] query
N/A
[DIR] query-no-results
N/A
[DIR] query-pagination
N/A
[DIR] query-pagination-next
N/A
[DIR] query-pagination-numbers
N/A
[DIR] query-pagination-previous
N/A
[DIR] query-title
N/A
[DIR] query-total
N/A
[DIR] quote
N/A
[DIR] read-more
N/A
[DIR] rss
N/A
[DIR] search
N/A
[DIR] separator
N/A
[DIR] shortcode
N/A
[DIR] site-logo
N/A
[DIR] site-tagline
N/A
[DIR] site-title
N/A
[DIR] social-link
N/A
[DIR] social-links
N/A
[DIR] spacer
N/A
[DIR] table
N/A
[DIR] tag-cloud
N/A
[DIR] template-part
N/A
[DIR] term-description
N/A
[DIR] text-columns
N/A
[DIR] verse
N/A
[DIR] video
N/A
[DIR] widget-group
N/A
archives.php
2.92 KB
Rename
Delete
avatar.php
5.61 KB
Rename
Delete
block.php
3.24 KB
Rename
Delete
blocks-json.php
189.40 KB
Rename
Delete
button.php
1.76 KB
Rename
Delete
calendar.php
5.93 KB
Rename
Delete
categories.php
3.92 KB
Rename
Delete
comment-author-name.php
2.08 KB
Rename
Delete
comment-content.php
2.40 KB
Rename
Delete
comment-date.php
1.82 KB
Rename
Delete
comment-edit-link.php
1.67 KB
Rename
Delete
comment-reply-link.php
2.03 KB
Rename
Delete
comment-template.php
4.39 KB
Rename
Delete
comments-pagination-next.php
1.88 KB
Rename
Delete
comments-pagination-numbers.php
1.59 KB
Rename
Delete
comments-pagination-previous.php
1.75 KB
Rename
Delete
comments-pagination.php
1.17 KB
Rename
Delete
comments-title.php
2.71 KB
Rename
Delete
comments.php
6.61 KB
Rename
Delete
cover.php
3.10 KB
Rename
Delete
file.php
1.75 KB
Rename
Delete
footnotes.php
3.68 KB
Rename
Delete
gallery.php
6.29 KB
Rename
Delete
heading.php
1.27 KB
Rename
Delete
home-link.php
5.31 KB
Rename
Delete
image.php
11.74 KB
Rename
Delete
index.php
4.99 KB
Rename
Delete
latest-comments.php
4.92 KB
Rename
Delete
latest-posts.php
8.34 KB
Rename
Delete
legacy-widget.php
3.90 KB
Rename
Delete
list.php
1.24 KB
Rename
Delete
loginout.php
1.38 KB
Rename
Delete
media-text.php
4.28 KB
Rename
Delete
navigation-link.php
13.59 KB
Rename
Delete
navigation-submenu.php
9.71 KB
Rename
Delete
navigation.php
48.46 KB
Rename
Delete
page-list-item.php
361 bytes
Rename
Delete
page-list.php
13.29 KB
Rename
Delete
pattern.php
1.75 KB
Rename
Delete
post-author-biography.php
1.49 KB
Rename
Delete
post-author-name.php
1.87 KB
Rename
Delete
post-author.php
2.63 KB
Rename
Delete
post-comments-form.php
2.74 KB
Rename
Delete
post-content.php
2.11 KB
Rename
Delete
post-date.php
3.05 KB
Rename
Delete
post-excerpt.php
3.37 KB
Rename
Delete
post-featured-image.php
9.14 KB
Rename
Delete
post-navigation-link.php
4.72 KB
Rename
Delete
post-template.php
5.61 KB
Rename
Delete
post-terms.php
3.55 KB
Rename
Delete
post-title.php
2.09 KB
Rename
Delete
query-no-results.php
1.80 KB
Rename
Delete
query-pagination-next.php
3.70 KB
Rename
Delete
query-pagination-numbers.php
4.66 KB
Rename
Delete
query-pagination-previous.php
3.50 KB
Rename
Delete
query-pagination.php
1.15 KB
Rename
Delete
query-title.php
2.05 KB
Rename
Delete
query-total.php
2.48 KB
Rename
Delete
query.php
5.56 KB
Rename
Delete
read-more.php
1.79 KB
Rename
Delete
require-dynamic-blocks.php
4.07 KB
Rename
Delete
require-static-blocks.php
501 bytes
Rename
Delete
rss.php
3.98 KB
Rename
Delete
search.php
22.48 KB
Rename
Delete
shortcode.php
735 bytes
Rename
Delete
site-logo.php
6.19 KB
Rename
Delete
site-tagline.php
1.17 KB
Rename
Delete
site-title.php
1.81 KB
Rename
Delete
social-link.php
63.65 KB
Rename
Delete
tag-cloud.php
1.55 KB
Rename
Delete
template-part.php
9.92 KB
Rename
Delete
term-description.php
1.30 KB
Rename
Delete
widget-group.php
2.38 KB
Rename
Delete
<?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 ); }
Save