Skip to content

Commit

Permalink
Prefer the automatic related post component since titles are not cont…
Browse files Browse the repository at this point in the history
…rollable with blocks.
  • Loading branch information
StevenDufresne committed Oct 27, 2022
1 parent b37cb0f commit 80c9d3a
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
13 changes: 0 additions & 13 deletions source/wp-content/themes/wporg-showcase-2022/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

// Filters and Actions
add_filter( 'jetpack_images_get_images', __NAMESPACE__ . '\jetpack_fallback_image', 10, 3 );
add_action( 'wp', __NAMESPACE__ . '\jetpackme_remove_rp', 20 );
add_filter( 'jetpack_relatedposts_filter_thumbnail_size', __NAMESPACE__ . '\jetpackchange_image_size' );

/**
Expand Down Expand Up @@ -79,18 +78,6 @@ function jetpack_fallback_image( $media, $post_id, $args ) {
}
}

/**
* Filter JetPack Related Posts from content so we can control it via a block.
*/
function jetpackme_remove_rp() {
if ( class_exists( 'Jetpack_RelatedPosts' ) ) {
$jprp = \Jetpack_RelatedPosts::init();
$callback = array( $jprp, 'filter_add_target_to_dom' );

remove_filter( 'the_content', $callback, 40 );
}
}

/**
* Change JetPack Related Posts image size.
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- wp:template-part {"slug":"header"} /-->

<!-- wp:group {"tagName":"main","style":{"spacing":{"blockGap":"0px"}},"className":"entry-content","layout":{"type":"constrained"}} -->
<!-- wp:group {"tagName":"main","style":{"spacing":{"blockGap":"0px"}},"className":"entry-content"} -->
<main class="wp-block-group entry-content">
<!-- wp:post-content /-->
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<!-- wp:post-title /-->
<!-- wp:post-content /-->
<!-- wp:post-terms {"term":"post_tag"} /-->
<!-- wp:pattern {"slug":"wporg-showcase-2022/related-posts"} /-->
</main>
<!-- /wp:group -->

Expand Down

0 comments on commit 80c9d3a

Please sign in to comment.