Feature any post type — posts, pages, attachments, or your own — and then query, style and sort by that flag.
| Status | Quality |
|---|---|
See CHANGELOG.md for release history and detailed changes.
Full documentation is in docs/post-type-spotlight. It publishes to
docs.linchpin.com once sync-docs.yml is promoted out of its dry-run posture.
The plugin adds a Feature this post control to the editor. It only appears on the post types an administrator enables under Settings → Writing.
When a post is designated as featured:
- It receives
featuredandfeatured-{$post_type}classes through thepost_classfilter. - A ⭐️ appears in a Featured column on that post type's admin list screen, with a Featured view that filters to just those posts.
- It is assigned the hidden
pts_feature_taxtaxonomy termfeatured, so it can be queried with a standardtax_query.
Because the flag is a taxonomy term rather than post meta, finding featured content is an indexed taxonomy lookup instead of a meta query. WordPress' own sticky posts only work on the core post type; this works on any type you enable.
| Requirement | Version |
|---|---|
| WordPress | 6.1 or later |
| PHP | 7.4 or later |
- Upload the plugin folder to
/wp-content/plugins/, or install Post Type Spotlight from the Plugins screen. - Activate it through the Plugins menu.
- Go to
Settings → Writingand tick the post types that should gain the featured control.
Step 3 is the one that makes the plugin do anything, so until it is done an admin notice links straight to that screen, and the plugin's row on the Plugins screen carries a Settings link to it.
In the block editor, the Summary panel of the sidebar gains a Feature Post type toggle. In the classic editor, the Publish meta box gains a checkbox whose label is filterable through pts_featured_checkbox_text.
$featured = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => 10,
'tax_query' => array(
array(
'taxonomy' => 'pts_feature_tax',
'field' => 'slug',
'terms' => array( 'featured' ),
),
),
)
);Swap 'operator' => 'NOT IN' into that clause to exclude featured posts instead. For a single post, has_term( 'featured', 'pts_feature_tax', $post_id ).
A Featured List variation of the core Query Loop block ships with the plugin. Search the inserter for featured or spotlight to find it.
Its Spotlight panel sets which posts the loop returns — Only featured, Featured first (everything, featured posts sorted to the top), or Exclude featured. How many it returns is the Query Loop's own Items per page setting.
Full walkthrough: The Featured List block.
Prerequisites:
- Node.js
>=20.20.2(see.nvmrc) - PHP
8.2for the toolchain — note the plugin itself still supports 7.4 - Composer
composer install
npm install
npm run buildnpm run build compiles blocks/src into blocks/build, which is committed because the plugin loads it at runtime. Use npm run start to watch.
composer lint # parse lint + PHPCS against the Linchpin standard
composer phpcbf # auto-fix what PHPCS can
npm run lint:js
npm run lint:css
npm run test:playground # boots the plugin in WordPress PlaygroundA pre-commit hook runs composer check-staged-cs, which scopes PHPCS to the lines a commit actually changes rather than whole files.
The test suite boots the plugin in WordPress Playground and drives its real admin screens with Playwright. Each spec captures a screenshot; in CI those upload as artifacts and post back to the pull request, so a visual regression in the editor sidebar or the posts list shows up in review.
npm run test:playground:headed # watch it run
npm run test:playground:ui # Playwright UI modeSpecs live in tests/playground/specs. blueprint.json seeds the Playground instance. A second blueprint at .wordpress-org/blueprints/blueprint.json powers the Live Preview button on WordPress.org and installs the released plugin from the directory instead.
Versioning is handled by release-please. Commit with Conventional Commits and it opens a release PR that bumps the version across post-type-spotlight.php, readme.txt, package.json and this file, and writes the changelog. Merging that PR tags the release, which triggers the GitHub release zip and the WordPress.org SVN deploy.
bash scripts/build.sh produces the distributable at build/post-type-spotlight — the same artifact Plugin Check inspects and the release ships.
Never hand-edit
CHANGELOG.md,.release-please-manifest.json, or a version string in a file release-please owns.
PHP follows linchpin/coding-standards via phpcs.xml.dist. testVersion is pinned to 7.4- rather than the standard's default, because the toolchain runs on PHP 8.2 while the plugin still ships to hosts on 7.4.

