e"> 3350 a4345e5759 first commit vor 5 Jahren 3351 a4345e5759 first commit vor 5 Jahren 3379 a4345e5759 first commit vor 5 Jahren 3380 a4345e5759 first commit vor 5 Jahren 3381 a4345e5759 first commit vor 5 Jahren 3394 a4345e5759 first commit vor 5 Jahren 3394_fsm a4345e5759 first commit vor 5 Jahren 3394_vm a4345e5759 first commit vor 5 Jahren 3395 a4345e5759 first commit vor 5 Jahren 3429 a4345e5759 first commit vor 5 Jahren 3430 a4345e5759 first commit vor 5 Jahren 3431 a4345e5759 first commit vor 5 Jahren 3433 a4345e5759 first commit vor 5 Jahren 3439 a4345e5759 first commit vor 5 Jahren 3440 a4345e5759 first commit vor 5 Jahren 3455 a4345e5759 first commit vor 5 Jahren 3456 a4345e5759 first commit vor 5 Jahren 3456_fsm a4345e5759 first commit vor 5 Jahren 3456_vm a4345e5759 first commit vor 5 Jahren 3466 a4345e5759 first commit vor 5 Jahren 3467 a4345e5759 first commit vor 5 Jahren 3468 a4345e5759 first commit vor 5 Jahren 3501 a4345e5759 first commit vor 5 Jahren 3502 a4345e5759 first commit vor 5 Jahren 3503 a4345e5759 first commit vor 5 Jahren 3534 a4345e5759 first commit vor 5 Jahren 3541 a4345e5759 first commit vor 5 Jahren 3541_fsm a4345e5759 first commit vor 5 Jahren 3541_vm a4345e5759 first commit vor 5 Jahren 3542 a4345e5759 first commit vor 5 Jahren 3574 a4345e5759 first commit vor 5 Jahren 3575 a4345e5759 first commit vor 5 Jahren 3576 a4345e5759 first commit vor 5 Jahren 3596 a4345e5759 first commit vor 5 Jahren 3597 a4345e5759 first commit vor 5 Jahren 3598 a4345e5759 first commit vor 5 Jahren 3599 a4345e5759 first commit vor 5 Jahren 3600 a4345e5759 first commit vor 5 Jahren 3600_fsm a4345e5759 first commit vor 5 Jahren 3600_vm a4345e5759 first commit vor 5 Jahren 3601 a4345e5759 first commit vor 5 Jahren 3601_fsm a4345e5759 first commit vor 5 Jahren 3601_vm a4345e5759 first commit vor 5 Jahren 3602 a4345e5759 first commit vor 5 Jahren 3602_fsm a4345e5759 first commit vor 5 Jahren 3602_vm a4345e5759 first commit vor 5 Jahren 3603 a4345e5759 first commit vor 5 Jahren 3603_fsm a4345e5759 first commit vor 5 Jahren 3603_vm a4345e5759 first commit vor 5 Jahren 3604 a4345e5759 first commit vor 5 Jahren 3605 a4345e5759 first commit vor 5 Jahren 3606 a4345e5759 first commit vor 5 Jahren 3607 a4345e5759 first commit vor 5 Jahren 3608 a4345e5759 first commit vor 5 Jahren 3609 a4345e5759 first commit vor 5 Jahren 3712 a4345e5759 first commit vor 5 Jahren 3764 a4345e5759 first commit vor 5 Jahren 3764_fsm a4345e5759 first commit vor 5 Jahren 3764_vm a4345e5759 first commit vor 5 Jahren 3766 a4345e5759 first commit vor 5 Jahren 3767 a4345e5759 first commit vor 5 Jahren 3997 a4345e5759 first commit vor 5 Jahren 4143 a4345e5759 first commit vor 5 Jahren 4144 a4345e5759 first commit vor 5 Jahren 4145 a4345e5759 first commit vor 5 Jahren 4146 a4345e5759 first commit vor 5 Jahren 4147 a4345e5759 first commit vor 5 Jahren 4148 a4345e5759 first commit vor 5 Jahren 4149 a4345e5759 first commit vor 5 Jahren 4150 a4345e5759 first commit vor 5 Jahren 4151 a4345e5759 first commit vor 5 Jahren 4152 a4345e5759 first commit vor 5 Jahren 4153 a4345e5759 first commit vor 5 Jahren 4154 a4345e5759 first commit vor 5 Jahren 4155 a4345e5759 first commit vor 5 Jahren 4156 a4345e5759 first commit vor 5 Jahren 4157 a4345e5759 first commit vor 5 Jahren 4158 a4345e5759 first commit vor 5 Jahren 4159 a4345e5759 first commit vor 5 Jahren 4160 a4345e5759 first commit vor 5 Jahren 4161 a4345e5759 first commit vor 5 Jahren 4162 a4345e5759 first commit vor 5 Jahren 4163 a4345e5759 first commit vor 5 Jahren 4164 a4345e5759 first commit vor 5 Jahren 4165 a4345e5759 first commit vor 5 Jahren 4166 a4345e5759 first commit vor 5 Jahren 4167 a4345e5759 first commit vor 5 Jahren 4168 a4345e5759 first commit vor 5 Jahren 4169 a4345e5759 first commit vor 5 Jahren 4170 a4345e5759 first commit vor 5 Jahren 4171 a4345e5759 first commit vor 5 Jahren 4172 a4345e5759 first commit vor 5 Jahren 4173 a4345e5759 first commit vor 5 Jahren 4174 a4345e5759 first commit vor 5 Jahren 5002 a4345e5759 first commit vor 5 Jahren 548 a4345e5759 first commit vor 5 Jahren 549 a4345e5759 first commit vor 5 Jahren 6102 a4345e5759 first commit vor 5 Jahren 6104 a4345e5759 first commit vor 5 Jahren 6106 a4345e5759 first commit vor 5 Jahren 6110 a4345e5759 first commit vor 5 Jahren 6111 a4345e5759 first commit vor 5 Jahren 6112 a4345e5759 first commit vor 5 Jahren 6113 a4345e5759 first commit vor 5 Jahren 6117 a4345e5759 first commit vor 5 Jahren 826 a4345e5759 first commit vor 5 Jahren 827 a4345e5759 first commit vor 5 Jahren 828 a4345e5759 first commit vor 5 Jahren PG_VERSION a4345e5759 first commit vor 5 Jahren pg_filenode.map a4345e5759 first commit vor 5 Jahren tum/whitesports - Gogs: Simplico Git Service

暫無描述

archives.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /**
  3. * Server-side rendering of the `core/archives` block.
  4. *
  5. * @package WordPress
  6. */
  7. /**
  8. * Renders the `core/archives` block on server.
  9. *
  10. * @see WP_Widget_Archives
  11. *
  12. * @param array $attributes The block attributes.
  13. *
  14. * @return string Returns the post content with archives added.
  15. */
  16. function render_block_core_archives( $attributes ) {
  17. $show_post_count = ! empty( $attributes['showPostCounts'] );
  18. $type = isset( $attributes['type'] ) ? $attributes['type'] : 'monthly';
  19. $class = '';
  20. if ( ! empty( $attributes['displayAsDropdown'] ) ) {
  21. $class .= ' wp-block-archives-dropdown';
  22. $dropdown_id = wp_unique_id( 'wp-block-archives-' );
  23. $title = __( 'Archives' );
  24. /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
  25. $dropdown_args = apply_filters(
  26. 'widget_archives_dropdown_args',
  27. array(
  28. 'type' => $type,
  29. 'format' => 'option',
  30. 'show_post_count' => $show_post_count,
  31. )
  32. );
  33. $dropdown_args['echo'] = 0;
  34. $archives = wp_get_archives( $dropdown_args );
  35. $classnames = esc_attr( $class );
  36. $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );
  37. switch ( $dropdown_args['type'] ) {
  38. case 'yearly':
  39. $label = __( 'Select Year' );
  40. break;
  41. case 'monthly':
  42. $label = __( 'Select Month' );
  43. break;
  44. case 'daily':
  45. $label = __( 'Select Day' );
  46. break;
  47. case 'weekly':
  48. $label = __( 'Select Week' );
  49. break;
  50. default:
  51. $label = __( 'Select Post' );
  52. break;
  53. }
  54. $block_content = '<label for="' . esc_attr( $dropdown_id ) . '">' . esc_html( $title ) . '</label>
  55. <select id="' . esc_attr( $dropdown_id ) . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
  56. <option value="">' . esc_html( $label ) . '</option>' . $archives . '</select>';
  57. return sprintf(
  58. '<div %1$s>%2$s</div>',
  59. $wrapper_attributes,
  60. $block_content
  61. );
  62. }
  63. $class .= ' wp-block-archives-list';
  64. /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */
  65. $archives_args = apply_filters(
  66. 'widget_archives_args',
  67. array(
  68. 'type' => $type,
  69. 'show_post_count' => $show_post_count,
  70. )
  71. );
  72. $archives_args['echo'] = 0;
  73. $archives = wp_get_archives( $archives_args );
  74. $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) );
  75. if ( empty( $archives ) ) {
  76. return sprintf(
  77. '<div %1$s>%2$s</div>',
  78. $wrapper_attributes,
  79. __( 'No archives to show.' )
  80. );
  81. }
  82. return sprintf(
  83. '<ul %1$s>%2$s</ul>',
  84. $wrapper_attributes,
  85. $archives
  86. );
  87. }
  88. /**
  89. * Register archives block.
  90. */
  91. function register_block_core_archives() {
  92. register_block_type_from_metadata(
  93. __DIR__ . '/archives',
  94. array(
  95. 'render_callback' => 'render_block_core_archives',
  96. )
  97. );
  98. }
  99. add_action( 'init', 'register_block_core_archives' );