PHPackages                             humanmade/altis-reusable-blocks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. humanmade/altis-reusable-blocks

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

humanmade/altis-reusable-blocks
===============================

Adds functionality to reusable blocks to enhance their usage.

v0.2.4(3y ago)11183.7k—3.8%1[22 PRs](https://github.com/humanmade/altis-reusable-blocks/pulls)2GPL-2.0-or-laterPHPPHP &gt;=7.1CI passing

Since Jan 29Pushed 3mo ago20 watchersCompare

[ Source](https://github.com/humanmade/altis-reusable-blocks)[ Packagist](https://packagist.org/packages/humanmade/altis-reusable-blocks)[ RSS](/packages/humanmade-altis-reusable-blocks/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (9)Versions (52)Used By (2)

Altis Reusable Blocks
=====================

[](#altis-reusable-blocks)

Altis Reusable Blocks provides enterprise workflows and added functionality for reusable blocks.

The main goals of Altis Reusable Blocks are to:

- provide a much more seamless implementation of reusable blocks into enterprise-level setups and workflows.
- provide an improved user interface that allows for better block discovery, including search and filtering.

[![](https://github.com/humanmade/altis-reusable-blocks/workflows/CI%20Check/badge.svg)](https://github.com/humanmade/altis-reusable-blocks/workflows/CI%20Check/badge.svg)[![](https://camo.githubusercontent.com/3a75afdc2f4d57a50cc010c60a29884e53485aa5ba5ce564c37cc66c1cd3325e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f68756d616e6d6164652f616c7469732d7265757361626c652d626c6f636b73)](https://camo.githubusercontent.com/3a75afdc2f4d57a50cc010c60a29884e53485aa5ba5ce564c37cc66c1cd3325e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f68756d616e6d6164652f616c7469732d7265757361626c652d626c6f636b73)

---

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
    - [Relationship and usage tracking](#relationship-and-usage-tracking)
    - [Admin Bar and Menu](#admin-bar-and-menu)
    - [Categories](#categories)
    - [Filtering](#filtering)
    - [Search](#search)
- [Installation](#installation)
    - [Build Process](#build-process)
    - [Requirements](#requirements)
    - [Tests](#tests)
        - [PHP Tests](#php-tests)
- [Usage](#usage)
    - [PHP Filters](#php-filters)
        - [`altis_post_types_with_reusable_blocks`](#altis_post_types_with_reusable_blocks)
        - [`rest_get_relationship_item_additional_fields_schema`](#rest_get_relationship_item_additional_fields_schema)
        - [`rest_prepare_relationships_response`](#rest_prepare_relationships_response)
- [Release Process](#release-process)
    - [Versioning](#versioning)
    - [Publishing a Release](#publishing-a-release)

---

Features
--------

[](#features)

Altis Reusable Blocks includes new features and improvements both for the creation and the discovery/usage of reusable blocks.

#### Relationship and usage tracking

[](#relationship-and-usage-tracking)

Keep track of all usages of reusable blocks within your posts. Within the edit screen for your reusable blocks, you will find the Relationships sidebar with a paginated view of all the posts that are using the reusable block that you are currently editing.

On the reusable blocks post list table, you can see at a quick glance the usage count for that reusable block.

#### Admin Bar and Menu

[](#admin-bar-and-menu)

By default, reusable blocks are somewhat hidden and can only be accessed from a submenu item in the block editor. With Altis Reusable Blocks, however, reusable blocks are upgraded to first-party citizens in the admin area.

Like for every other content type, the admin menu on the left now contains a dedicated submenu for reusable blocks, offering shortcuts to see all existing reusable blocks, to create a new reusable block, and to see and manage categories, as well as any other publicly available taxonomy registered for reusable blocks. Also, the admin bar at the top now contains a shortcut to create a new reusable block, just like it is possible to do for posts, media, pages or users.

#### Categories

[](#categories)

Just like posts or pages, reusable blocks can have one or more categories assigned to them. This helps in discovering relevant blocks by making use of the dedicated Category filter included in the block picker.

#### Filtering

[](#filtering)

When looking for an existing reusable block to insert into a post, the new block picker allows to search/filter based on a category.

By default, the Category filter is set to the (main) category of the current post. However, this can be changed, without affecting the post's categories.

#### Search

[](#search)

In addition to the Category filter, the block picker also provides a search field. The search query is used to find reusable blocks with either a matching title or content, or both. Search results are sorted based on a smart algorithm using different weights for title matches vs. content matches, and exact matches vs. partial matches. As a result, more relevant blocks are displayed first.

The search input also supports numeric ID lookups. By entering a block ID, the result set will be just that one according block, ready to be inserted. If the provided ID is a post ID, the results will be all reusable blocks referenced by that post, if any.

---

Installation
------------

[](#installation)

Install with [Composer](https://getcomposer.org):

```
composer require humanmade/altis-reusable-blocks
```

### Build Process

[](#build-process)

Create a **production** build:

```
yarn build
```

Start the interactive **development** server:

```
yarn start
```

### Requirements

[](#requirements)

This plugin requires PHP 8.1 or higher.

### Tests

[](#tests)

### PHP Tests

[](#php-tests)

The PHP tests live in the `tests` folder, with subfolders for each individual test level. Currently, this means unit tests, living in `tests/unit`.

Run the PHP unit tests:

```
composer test:unit
```

Under the hood, this is using `PHPUnit`, as specified in the `composer.json` file. Any arguments passed to the script will then be passed on to the `phpunit` cli, meaning you can target specific files/names, like so:

```
composer test:unit -- --filter logging
```

---

Usage
-----

[](#usage)

### PHP Filters

[](#php-filters)

#### `altis_post_types_with_reusable_blocks`

[](#altis_post_types_with_reusable_blocks)

This filter allows the user to manipulate the post types that can use reusable blocks and should have the relationship for the shadow taxonomy.

**Arguments:**

- `$post_types` (`string[]`): List of post type slugs.

**Usage Example:**

```
// Add the "page" post type.
add_filter( 'altis_post_types_with_reusable_blocks', function ( aray $post_types ): array {

	$post_types[] = 'page';

	return $post_types;
} );
```

---

#### `rest_get_relationship_item_additional_fields_schema`

[](#rest_get_relationship_item_additional_fields_schema)

This filter allows the user to modify the schema for the relationship data before it is returned from the REST API.

**Arguments:**

- `$schema` (`array`): Item schema data.

**Usage Example:**

```
// Add the post author to the schema.
add_filter( 'rest_get_relationship_item_additional_fields_schema', function ( array $additional_fields ): array {

	$additional_fields['author'] = [
		'description' => __( 'User ID for the author of the post.' ),
		'type'        => 'integer',
		'context'     => [ 'view' ],
		'readonly'    => true,
	];

	return $additional_fields;
} );
```

---

#### `rest_prepare_relationships_response`

[](#rest_prepare_relationships_response)

This filter allows the user to modify the relationship data right before it is returned from the REST API.

**Arguments:**

- `$response` (`WP_REST_Response`): Response object.
- `$post` (`WP_Post`): Post object.
- `$request` (`WP_REST_Request`): Request object.

**Usage Example:**

```
// Add the post author to the REST response.
add_filter( 'rest_prepare_relationships_response', function ( WP_REST_Response $response, WP_Post $post ): WP_REST_Response {

	$response->data['author'] = $post->post_author;

	return $response;
}, 10, 2 );
```

---

Release Process
---------------

[](#release-process)

### Versioning

[](#versioning)

This plugin follows [Semantic Versioning](https://semver.org/).

In a nutshell, this means that **patch releases**, for example, 1.2.3, only contain **backwards compatible bug fixes**. **Minor releases**, for example, 1.2.0, may contain **enhancements, new features, tests**, and pretty much everything that **does not break backwards compatibility**. Every **breaking change** to public APIs—be it renaming or even deleting structures intended for reuse, or making backwards-incompatible changes to certain functionality—warrants a **major release**, for example, 2.0.0.

If you are using Composer to pull this plugin into your website build, choose your version constraint accordingly.

### Publishing a Release

[](#publishing-a-release)

Release management is done using GitHub's built-in Releases functionality. Each release is tagged using the according version number, for example, the version 1.2.3 of this plugin would have the tag name `v1.2.3`. Releases should be created off the `master` branch, and tagged in the correct format. When a release is tagged in the correct format of `v*.*.*`, the GitHub actions release workflow creates a new built release based on the original release you just created. It will copy the tag's current state to a new tag of `original/v.*.*.*` and then build the project and push the built version to the original tag name `v*.*.*`. This allows composer to pull in a built version of the project without the need to run webpack to use it.

For better information management, every release should come with complete, but high-level Release Notes, detailing all *New Features*, *Enhancements*, *Bug Fixes* and potential other changes included in the according version.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance54

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~43 days

Recently: every ~103 days

Total

25

Last Release

1253d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/21655?v=4)[Ryan McCue](/maintainers/rmccue)[@rmccue](https://github.com/rmccue)

![](https://www.gravatar.com/avatar/77dbeefb7745010589603f2ffc6ff310d8f700b58e08d52af190744c43342526?d=identicon)[roborourke](/maintainers/roborourke)

![](https://www.gravatar.com/avatar/f1d0ffccdc5d339ff98a91e1b224a0d92f93dc8c2f772124473a76655b83129c?d=identicon)[joehoyle](/maintainers/joehoyle)

![](https://www.gravatar.com/avatar/d90a938633be46488e62828ea10317d70e8d039bdd5070f5760139ca91a38362?d=identicon)[kovshenin](/maintainers/kovshenin)

---

Top Contributors

[![kevinlangleyjr](https://avatars.githubusercontent.com/u/877634?v=4)](https://github.com/kevinlangleyjr "kevinlangleyjr (85 commits)")[![roborourke](https://avatars.githubusercontent.com/u/23417?v=4)](https://github.com/roborourke "roborourke (13 commits)")[![mikelittle](https://avatars.githubusercontent.com/u/358499?v=4)](https://github.com/mikelittle "mikelittle (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![jerico](https://avatars.githubusercontent.com/u/1062325?v=4)](https://github.com/jerico "jerico (3 commits)")[![kadamwhite](https://avatars.githubusercontent.com/u/442115?v=4)](https://github.com/kadamwhite "kadamwhite (3 commits)")

---

Tags

wordpress-plugin

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/humanmade-altis-reusable-blocks/health.svg)

```
[![Health](https://phpackages.com/badges/humanmade-altis-reusable-blocks/health.svg)](https://phpackages.com/packages/humanmade-altis-reusable-blocks)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[altis/cms

CMS Module for Altis

46216.6k2](/packages/altis-cms)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
