@@ -164,52 +164,6 @@ public static function register_blocks() {
164
164
\register_block_type_from_metadata ( ACTIVITYPUB_PLUGIN_DIR . '/build/reactions ' );
165
165
}
166
166
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
-
213
167
/**
214
168
* Get the user ID from a user string.
215
169
*
0 commit comments