Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4383448

Browse files
authoredMay 30, 2025··
Shared JS: Remove unused components (#1749)
1 parent e771890 commit 4383448

File tree

4 files changed

+0
-351
lines changed

4 files changed

+0
-351
lines changed
 

‎includes/class-blocks.php

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -164,52 +164,6 @@ public static function register_blocks() {
164164
\register_block_type_from_metadata( ACTIVITYPUB_PLUGIN_DIR . '/build/reactions' );
165165
}
166166

167-
/**
168-
* Render the post reactions block.
169-
*
170-
* @param array $attrs The block attributes.
171-
* @param string $content Inner blocks.
172-
*
173-
* @return string The HTML to render.
174-
*/
175-
public static function render_post_reactions_block( $attrs, $content ) {
176-
if ( ! isset( $attrs['postId'] ) ) {
177-
$attrs['postId'] = \get_the_ID();
178-
}
179-
180-
// Fallback for v1.0.0 blocks.
181-
if ( empty( $content ) ) {
182-
$title = $attrs['title'] ?? \__( 'Fediverse Reactions', 'activitypub' );
183-
$content = '<h6 class="wp-block-heading">' . \esc_html( $title ) . '</h6>' . "\n"
184-
. '<div class="activitypub-reactions-block"></div>';
185-
unset( $attrs['title'], $attrs['className'] );
186-
}
187-
188-
// Hide the title if there are no comments.
189-
$has_comments = \get_comments(
190-
array(
191-
'post_id' => $attrs['postId'],
192-
'fields' => 'ids',
193-
'type' => Comment::get_comment_type_slugs(),
194-
)
195-
);
196-
if ( ! $has_comments ) {
197-
$tags = new \WP_HTML_Tag_Processor( $content );
198-
199-
while ( $tags->next_tag( array( 'class_name' => 'wp-block-heading' ) ) ) {
200-
$tags->set_attribute( 'hidden', true );
201-
}
202-
203-
$content = $tags->get_updated_html();
204-
}
205-
206-
return \sprintf(
207-
'<div %1$s>%2$s</div>',
208-
\get_block_wrapper_attributes( array( 'data-attrs' => \wp_json_encode( $attrs ) ) ),
209-
$content
210-
);
211-
}
212-
213167
/**
214168
* Get the user ID from a user string.
215169
*

‎src/shared/dialog.js

Lines changed: 0 additions & 163 deletions
This file was deleted.

‎src/shared/lightbox.scss

Lines changed: 0 additions & 76 deletions
This file was deleted.

‎src/shared/use-remote-user.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.