From 5bf66662a9bdd62c5bccab15e607cd95cfb8fcab Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 27 Jul 2020 10:05:23 +0200 Subject: Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my familly --- .../wp-includes/blocks/latest-comments.php | 196 --------------------- 1 file changed, 196 deletions(-) delete mode 100644 srcs/wordpress/wp-includes/blocks/latest-comments.php (limited to 'srcs/wordpress/wp-includes/blocks/latest-comments.php') diff --git a/srcs/wordpress/wp-includes/blocks/latest-comments.php b/srcs/wordpress/wp-includes/blocks/latest-comments.php deleted file mode 100644 index d68e89a..0000000 --- a/srcs/wordpress/wp-includes/blocks/latest-comments.php +++ /dev/null @@ -1,196 +0,0 @@ - $attributes['commentsToShow'], - 'status' => 'approve', - 'post_status' => 'publish', - ) - ) - ); - - $list_items_markup = ''; - if ( ! empty( $comments ) ) { - // Prime the cache for associated posts. This is copied from \WP_Widget_Recent_Comments::widget(). - $post_ids = array_unique( wp_list_pluck( $comments, 'comment_post_ID' ) ); - _prime_post_caches( $post_ids, strpos( get_option( 'permalink_structure' ), '%category%' ), false ); - - foreach ( $comments as $comment ) { - $list_items_markup .= '
  • '; - if ( $attributes['displayAvatar'] ) { - $avatar = get_avatar( - $comment, - 48, - '', - '', - array( - 'class' => 'wp-block-latest-comments__comment-avatar', - ) - ); - if ( $avatar ) { - $list_items_markup .= $avatar; - } - } - - $list_items_markup .= '
    '; - $list_items_markup .= ''; - if ( $attributes['displayExcerpt'] ) { - $list_items_markup .= '
    ' . wpautop( get_comment_excerpt( $comment ) ) . '
    '; - } - $list_items_markup .= '
  • '; - } - } - - $class = 'wp-block-latest-comments'; - if ( ! empty( $attributes['className'] ) ) { - $class .= ' ' . $attributes['className']; - } - if ( isset( $attributes['align'] ) ) { - $class .= " align{$attributes['align']}"; - } - if ( $attributes['displayAvatar'] ) { - $class .= ' has-avatars'; - } - if ( $attributes['displayDate'] ) { - $class .= ' has-dates'; - } - if ( $attributes['displayExcerpt'] ) { - $class .= ' has-excerpts'; - } - if ( empty( $comments ) ) { - $class .= ' no-comments'; - } - $classnames = esc_attr( $class ); - - return ! empty( $comments ) ? sprintf( - '
      %2$s
    ', - $classnames, - $list_items_markup - ) : sprintf( - '
    %2$s
    ', - $classnames, - __( 'No comments to show.' ) - ); -} - -/** - * Registers the `core/latest-comments` block. - */ -function register_block_core_latest_comments() { - register_block_type( - 'core/latest-comments', - array( - 'attributes' => array( - 'align' => array( - 'type' => 'string', - 'enum' => array( - 'left', - 'center', - 'right', - 'wide', - 'full', - ), - ), - 'className' => array( - 'type' => 'string', - ), - 'commentsToShow' => array( - 'type' => 'number', - 'default' => 5, - 'minimum' => 1, - 'maximum' => 100, - ), - 'displayAvatar' => array( - 'type' => 'boolean', - 'default' => true, - ), - 'displayDate' => array( - 'type' => 'boolean', - 'default' => true, - ), - 'displayExcerpt' => array( - 'type' => 'boolean', - 'default' => true, - ), - ), - 'render_callback' => 'render_block_core_latest_comments', - ) - ); -} - -add_action( 'init', 'register_block_core_latest_comments' ); -- cgit