Skip to content

Display the latest posts for a specified post type, taxonomy, and term.

License

Notifications You must be signed in to change notification settings

happyprime/content-aggregator-block

Repository files navigation

Content Aggregator Block

Release process

In the latest release branch:

  • wp dist-archive ./ content-aggregator-block.zip --format=zip
  • Tag a release in GitHub and attach content-aggregator-block.zip to the release.

Filters

The following filters are provided to allow customization and extensibility.

contentAggregatorBlock.ExcludePostTypes

This JavaScript filter can be used to modify the options available in the Post type dropdown within the Sorting and Filtering panel. It receives the default array of post type slugs excluded from the options.

contentAggregatorBlock.itemHTML

This JavaScript filter can be used to modify the markup for an individual post item as displayed on editor views. It receives the default markup, the post data (as returned by the REST API route registered by this plugin), and the block attributes.

content_aggregator_block_item

This PHP filter can be used to modify the markup for an individual post item as displayed on front-end views. It receives the default markup, the post data, and the block attributes.

content_aggregator_block_endpoint_post_data

This PHP filter can be used to modify the data returned by the REST API route registered by this plugin. It receives the default data and the post ID.

Changelog

0.7.0

  • Add WP-CLI commands for auditing and upgrading deprecated attributes.
  • Improve fallback handling for deprecated customTaxonomy attribute.
  • Improve handling of the customPostType attribute.
  • Update PHP tooling to use Happy Prime coding standards.
  • Fix a bug when generating post format classes.

1.0.0 will be a breaking change that eliminates the customTaxonomy attribute, termID attribute, and happyprime/latest-custom-posts transform handler.

0.6.1

  • Add missing default value for customTaxonomy block attribute.
  • Bump minimum PHP support to 7.4.

0.6.0

  • Use post meta to identify which content contains content aggregator blocks.
  • Clear Kinsta page cache for URLs containing content aggregator blocks when content is updated.
  • Fix a class name attribute for byline authors.
  • Update project to use Node 18.
  • Update wordpress/scripts to 26.6.0.

0.5.3

  • Allow more than 100 items in a Content Aggregator block.
  • Update wordpress/scripts to 26.1.0.

0.5.2

  • Add content_aggregator_block_pre_render_item filter to allow a plugin or theme to fully take over the display of an item.

0.5.1

  • Add last modified date to sorting options.

0.5.0

  • Enable scrolling in the multiple select interface used for terms.
  • Add a cab-item-title class to the anchor wrapping item titles.
  • Fix an issue looping through post IDs instead of objects.

0.4.1

  • Allow CAB to be filtered by non-public taxonomies.