Nama File / Folder
Size
Action
accordion
--
NONE
accordion-heading
--
NONE
accordion-item
--
NONE
accordion-panel
--
NONE
archives
--
NONE
audio
--
NONE
avatar
--
NONE
block
--
NONE
button
--
NONE
buttons
--
NONE
calendar
--
NONE
categories
--
NONE
code
--
NONE
column
--
NONE
columns
--
NONE
comment-author-name
--
NONE
comment-content
--
NONE
comment-date
--
NONE
comment-edit-link
--
NONE
comment-reply-link
--
NONE
comment-template
--
NONE
comments
--
NONE
comments-pagination
--
NONE
comments-pagination-next
--
NONE
comments-pagination-numbers
--
NONE
comments-pagination-previous
--
NONE
comments-title
--
NONE
cover
--
NONE
details
--
NONE
embed
--
NONE
file
--
NONE
footnotes
--
NONE
freeform
--
NONE
gallery
--
NONE
group
--
NONE
heading
--
NONE
home-link
--
NONE
html
--
NONE
image
--
NONE
latest-comments
--
NONE
latest-posts
--
NONE
legacy-widget
--
NONE
list
--
NONE
list-item
--
NONE
loginout
--
NONE
math
--
NONE
media-text
--
NONE
missing
--
NONE
more
--
NONE
navigation
--
NONE
navigation-link
--
NONE
navigation-submenu
--
NONE
nextpage
--
NONE
page-list
--
NONE
page-list-item
--
NONE
paragraph
--
NONE
pattern
--
NONE
post-author
--
NONE
post-author-biography
--
NONE
post-author-name
--
NONE
post-comments-count
--
NONE
post-comments-form
--
NONE
post-comments-link
--
NONE
post-content
--
NONE
post-date
--
NONE
post-excerpt
--
NONE
post-featured-image
--
NONE
post-navigation-link
--
NONE
post-template
--
NONE
post-terms
--
NONE
post-time-to-read
--
NONE
post-title
--
NONE
preformatted
--
NONE
pullquote
--
NONE
query
--
NONE
query-no-results
--
NONE
query-pagination
--
NONE
query-pagination-next
--
NONE
query-pagination-numbers
--
NONE
query-pagination-previous
--
NONE
query-title
--
NONE
query-total
--
NONE
quote
--
NONE
read-more
--
NONE
rss
--
NONE
search
--
NONE
separator
--
NONE
shortcode
--
NONE
site-logo
--
NONE
site-tagline
--
NONE
site-title
--
NONE
social-link
--
NONE
social-links
--
NONE
spacer
--
NONE
table
--
NONE
tag-cloud
--
NONE
template-part
--
NONE
term-count
--
NONE
term-description
--
NONE
term-name
--
NONE
term-template
--
NONE
terms-query
--
NONE
text-columns
--
NONE
verse
--
NONE
video
--
NONE
widget-group
--
NONE
accordion-item.php
2.354KB
Hapus
Edit
Rename
accordion.php
1.12KB
Hapus
Edit
Rename
archives.php
4.312KB
Hapus
Edit
Rename
avatar.php
5.61KB
Hapus
Edit
Rename
block.php
4.088KB
Hapus
Edit
Rename
blocks-json.php
213.431KB
Hapus
Edit
Rename
calendar.php
5.933KB
Hapus
Edit
Rename
categories.php
4.541KB
Hapus
Edit
Rename
comment-author-name.php
2.083KB
Hapus
Edit
Rename
comment-date.php
1.819KB
Hapus
Edit
Rename
comment-reply-link.php
2.026KB
Hapus
Edit
Rename
comment-template.php
4.389KB
Hapus
Edit
Rename
comments-pagination-next.php
1.879KB
Hapus
Edit
Rename
comments-pagination-numbers.php
1.594KB
Hapus
Edit
Rename
comments-pagination-previous.php
1.748KB
Hapus
Edit
Rename
comments-pagination.php
1.231KB
Hapus
Edit
Rename
comments.php
6.625KB
Hapus
Edit
Rename
footnotes.php
3.683KB
Hapus
Edit
Rename
gallery.php
6.288KB
Hapus
Edit
Rename
heading.php
1.271KB
Hapus
Edit
Rename
home-link.php
5.311KB
Hapus
Edit
Rename
index.php
11.972KB
Hapus
Edit
Rename
latest-comments.php
4.912KB
Hapus
Edit
Rename
legacy-widget.php
3.917KB
Hapus
Edit
Rename
list.php
1.243KB
Hapus
Edit
Rename
loginout.php
1.625KB
Hapus
Edit
Rename
media-text.php
4.28KB
Hapus
Edit
Rename
navigation-link.php
13.634KB
Hapus
Edit
Rename
navigation-submenu.php
9.742KB
Hapus
Edit
Rename
page-list-item.php
0.353KB
Hapus
Edit
Rename
page-list.php
13.292KB
Hapus
Edit
Rename
pattern.php
1.746KB
Hapus
Edit
Rename
post-author-biography.php
1.488KB
Hapus
Edit
Rename
post-author-name.php
1.905KB
Hapus
Edit
Rename
post-author.php
2.67KB
Hapus
Edit
Rename
post-comments-form.php
2.739KB
Hapus
Edit
Rename
post-comments-link.php
2.185KB
Hapus
Edit
Rename
post-date.php
3.547KB
Hapus
Edit
Rename
post-featured-image.php
9.144KB
Hapus
Edit
Rename
post-navigation-link.php
4.724KB
Hapus
Edit
Rename
post-terms.php
3.555KB
Hapus
Edit
Rename
post-time-to-read.php
6.341KB
Hapus
Edit
Rename
post-title.php
2.088KB
Hapus
Edit
Rename
query-pagination-previous.php
3.494KB
Hapus
Edit
Rename
query-pagination.php
1.148KB
Hapus
Edit
Rename
query-total.php
2.476KB
Hapus
Edit
Rename
query.php
5.557KB
Hapus
Edit
Rename
read-more.php
1.787KB
Hapus
Edit
Rename
require-dynamic-blocks.php
4.59KB
Hapus
Edit
Rename
require-static-blocks.php
0.545KB
Hapus
Edit
Rename
rss.php
4.501KB
Hapus
Edit
Rename
search.php
23.259KB
Hapus
Edit
Rename
shortcode.php
0.718KB
Hapus
Edit
Rename
site-tagline.php
1.175KB
Hapus
Edit
Rename
site-title.php
1.82KB
Hapus
Edit
Rename
social-link.php
66.147KB
Hapus
Edit
Rename
tag-cloud.php
1.553KB
Hapus
Edit
Rename
template-part.php
9.916KB
Hapus
Edit
Rename
term-count.php
1.8KB
Hapus
Edit
Rename
term-description.php
1.729KB
Hapus
Edit
Rename
term-name.php
2.021KB
Hapus
Edit
Rename
term-template.php
4.412KB
Hapus
Edit
Rename
widget-group.php
2.381KB
Hapus
Edit
Rename
<=Back
<?php /** * Server-side rendering of the `core/archives` block. * * @package WordPress */ /** * Renders the `core/archives` block on server. * * @since 5.0.0 * * @see WP_Widget_Archives * * @param array $attributes The block attributes. * * @return string Returns the post content with archives added. */ function render_block_core_archives( $attributes ) { $show_post_count = ! empty( $attributes['showPostCounts'] ); $type = isset( $attributes['type'] ) ? $attributes['type'] : 'monthly'; $class = 'wp-block-archives-list'; if ( ! empty( $attributes['displayAsDropdown'] ) ) { $class = 'wp-block-archives-dropdown'; $dropdown_id = wp_unique_id( 'wp-block-archives-' ); $title = __( 'Archives' ); /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */ $dropdown_args = apply_filters( 'widget_archives_dropdown_args', array( 'type' => $type, 'format' => 'option', 'show_post_count' => $show_post_count, ) ); $dropdown_args['echo'] = 0; $archives = wp_get_archives( $dropdown_args ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) ); switch ( $dropdown_args['type'] ) { case 'yearly': $label = __( 'Select Year' ); break; case 'monthly': $label = __( 'Select Month' ); break; case 'daily': $label = __( 'Select Day' ); break; case 'weekly': $label = __( 'Select Week' ); break; default: $label = __( 'Select Post' ); break; } $show_label = empty( $attributes['showLabel'] ) ? ' screen-reader-text' : ''; $block_content = '<label for="' . $dropdown_id . '" class="wp-block-archives__label' . $show_label . '">' . esc_html( $title ) . '</label> <select id="' . esc_attr( $dropdown_id ) . '" name="archive-dropdown"> <option value="">' . esc_html( $label ) . '</option>' . $archives . '</select>'; // Inject the dropdown script immediately after the select dropdown. $block_content .= block_core_archives_build_dropdown_script( $dropdown_id ); return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $block_content ); } /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */ $archives_args = apply_filters( 'widget_archives_args', array( 'type' => $type, 'show_post_count' => $show_post_count, ) ); $archives_args['echo'] = 0; $archives = wp_get_archives( $archives_args ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) ); if ( empty( $archives ) ) { return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, __( 'No archives to show.' ) ); } return sprintf( '<ul %1$s>%2$s</ul>', $wrapper_attributes, $archives ); } /** * Generates the inline script for an archives dropdown field. * * @since 6.9.0 * * @param string $dropdown_id ID of the dropdown field. * * @return string Returns the dropdown onChange redirection script. */ function block_core_archives_build_dropdown_script( $dropdown_id ) { ob_start(); $exports = array( $dropdown_id, home_url() ); ?> <script> ( ( [ dropdownId, homeUrl ] ) => { const dropdown = document.getElementById( dropdownId ); function onSelectChange() { setTimeout( () => { if ( 'escape' === dropdown.dataset.lastkey ) { return; } if ( dropdown.value ) { location.href = dropdown.value; } }, 250 ); } function onKeyUp( event ) { if ( 'Escape' === event.key ) { dropdown.dataset.lastkey = 'escape'; } else { delete dropdown.dataset.lastkey; } } function onClick() { delete dropdown.dataset.lastkey; } dropdown.addEventListener( 'keyup', onKeyUp ); dropdown.addEventListener( 'click', onClick ); dropdown.addEventListener( 'change', onSelectChange ); } )( <?php echo wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> ); </script> <?php return wp_get_inline_script_tag( trim( str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) ) . "\n//# sourceURL=" . rawurlencode( __FUNCTION__ ) ); } /** * Register archives block. * * @since 5.0.0 */ function register_block_core_archives() { register_block_type_from_metadata( __DIR__ . '/archives', array( 'render_callback' => 'render_block_core_archives', ) ); } add_action( 'init', 'register_block_core_archives' );
Liking