Add categorized "click to reveal" notes inline with your text. Create reusable notes via Custom Post Type and manage them centrally with modular, maintainable architecture. Perfect for short explanations, definitions, and asides with custom icons and full styling control.
This plugin originated from a project with Renée Kool — a visual artist working in public art, film, and emerging media. She wanted to create a website where a single link could reveal additional content containing multiple related links.
As inspiration, we looked at the Dutch journalism platform De Correspondent, which uses inline contextual notes: small linked text fragments with an icon. When activated, they reveal an extra HTML element containing supplementary information. These contextual notes can:
- provide definitions
- offer additional context before the reader follows links in the main text
- stay out of the way to keep the article readable
You can see examples of their inline notes in this article:
https://decorrespondent.nl/16239/hoe-vriendschap-de-belangrijkste-relatie-werd-van-deze-tijd/2bc79aff-1546-08e1-349f-e865e38c46da
Renée Kool’s website:
https://reneekool.nl/
Major refactoring and architectural improvements:
- Modular Architecture: Complete codebase refactoring from monolithic to 7 class-based modules (83% main file reduction)
- Enhanced Maintainability: Separation of concerns with dedicated classes for CPT, Taxonomy Meta, Sync, Deletion, REST API, Frontend, and Utilities
- Code Quality: Full WordPress coding standards compliance (JavaScript and PHP)
- Performance: Optimized class autoloading and initialization
- Developer Experience: Clean, testable, and extensible codebase
- Backward Compatibility: Seamless upgrade from v1.x with preserved functionality
- Lets you attach a brief note to any piece of text in the block editor
- Create reusable notes that can be used across multiple posts (v1.5)
- Search and insert existing notes instantly from the editor (v1.5)
- Track usage to see where each note is used on your site (v1.5)
- Choose display mode: Show notes inline or as floating tooltips (v2.1)
- Organize notes with custom categories (Internal Article, External Article, Definition, Tip, etc.)
- Each category has distinct icons for closed/open states
- Readers click the highlighted text to show the note inline or in a tooltip, and click again to hide it
- Full styling control through tabbed admin interface
- Keeps pages clean and easy to scan while still offering helpful context
- Browser AI Integration: Claude, ChatGPT, and other AI assistants can discover and use plugin capabilities
- REST API Discovery: All features exposed via WordPress Abilities API for AI agents
- Automatic Note Creation: AI can create inline context notes while generating content
- Smart Reuse: AI can search and reuse existing notes to maintain consistency
- One-Step HTML Generation:
create-inline-noteability returns ready-to-embed markup - Authentication Support: Works with cookie auth (browser) or Application Passwords
- Complete Documentation: See ABILITIES-API.md for full API reference and AI workflows
- Custom Post Type: Notes stored as
inline_context_noteCPT for centralized management - Live Search: Quickly find and insert existing notes from the editor popover
- Create or Reuse: Choose to create new notes or select from existing library
- Usage Tracking: See which posts use each note with enhanced list view
- Filter by Type: Filter notes marked as reusable in the admin list
- Bulk Delete: Delete reusable notes with automatic cleanup from all posts
- Smart Deletion: Confirmation dialogs show exactly how many uses will be removed from how many posts
- Cached Performance: Notes cached in content for optimal frontend speed
- Automatic Cleanup (v2.2): Daily background job removes non-reusable notes that are no longer in use (usage count = 0)
- Custom Categories: Create unlimited categories to organize your notes
- Icon Selection: Choose from 30 curated Dashicons or use any of 300+ available
- Visual Icon Picker: Accessible modal with keyboard navigation (Esc, Tab, Enter)
- Dual Icon States: Different icons for closed/open states provide visual feedback
- Color Coding: Assign colors to each category for visual distinction
- Inline Mode (default): Notes expand directly below the trigger text in the content flow
- Tooltip Mode: Notes appear as floating positioned tooltips above or below the trigger
- Hover Activation (v2.3): Optional hover to show tooltips with 300ms delay and smooth mouse transition
- Smart Mouse Interaction (v2.3): Keep tooltip open when moving mouse from trigger to tooltip content
- Smart Positioning: Tooltips automatically flip position to stay within viewport
- Accessibility First: Both modes support full keyboard navigation and screen readers
- Click/Keyboard Activation: Tooltips activate on click or keyboard (Space/Enter)
- Focus Management: Automatic focus on note content for keyboard users
- Escape to Close: Press Escape to close tooltips and return focus to trigger
- Tabbed Interface: Clean admin settings with General, Categories, Styling, and Uninstall tabs
- Display Mode Setting: Choose between inline or tooltip display on the General tab
- Comprehensive Options: Control colors, spacing, borders, shadows for every element
- Organized Sections: Shared settings grouped first, then mode-specific options
- Helpful Descriptions: Every setting includes clear explanation of its purpose
- Direct Anchor Links: Every note gets a unique URL anchor for easy sharing (#context-note-xxx)
- Auto-Opening: Notes automatically open when accessed via direct link
- Smart Link Behavior: Internal links stay in same tab, external links open in new tab with security
- Rich Text Support: Notes support bold, italic, links, lists with ReactQuill editor
- Security First: Content sanitized with DOMPurify before frontend display
- Full Accessibility: ARIA support, keyboard navigation, focus management
- Go to Settings > Inline Context
- Click the General tab
- Choose between:
- Inline notes (default) - Notes expand in the content flow
- Tooltips - Notes appear as floating positioned elements
- NEW in v2.3: If tooltips are selected, optionally enable "Also display the tooltip on mouse hover"
- Tooltips will appear after hovering for 0.3 seconds
- Tooltip stays open when moving mouse to the tooltip content
- Click and keyboard activation still work as normal
- Save your settings
- Go to Inline Context > All Notes in WordPress admin
- Create new notes or edit existing ones
- Mark notes as "Reusable" to use them across multiple posts
- View usage statistics to see where each note is used
- Use the filter dropdown to show only reusable notes
- Delete notes with confidence - the system shows exactly how many uses will be removed from how many posts
- Go to Settings > Inline Context
- Click the Categories tab
- Add or edit categories with custom names, icons, and colors
- Click the icon button to open the visual picker
- Save your settings
- Select the text you want to explain
- Click the "Inline Context" button in the formatting toolbar
- NEW in v1.5: Use the Search tab to find existing notes, or Create tab for new ones
- Choose a category (optional)
- Type your note content (or select from search results)
- Save and view your page
- Go to Settings > Inline Context > Styling tab
- Adjust link colors, note styling, chevron appearance
- See changes immediately in the live preview
- Save settings
The plugin supports extensive styling customization through:
- Admin Settings: Tabbed interface with comprehensive visual controls
- CSS Variables: All settings use CSS custom properties for easy override
- Live Preview: See changes in real-time before saving
For detailed styling instructions and examples, see STYLING.md.
The plugin exposes all its functionality via the WordPress Abilities API, allowing browser-based AI assistants (Claude, ChatGPT, etc.) to discover and use the plugin automatically.
Available Abilities:
create-note- Create new notessearch-notes- Find existing notesget-categories- List available categoriesget-note- Fetch specific note by IDcreate-inline-note- Create note and get ready-to-embed HTML (AI helper)
Complete Documentation:
See ABILITIES-API.md for full API reference, authentication details, workflows, and code examples.
For developer filters and programmatic customization, see FILTERS.md.
For complete version history and detailed changelog, see changelog.txt.
For future feature ideas and version 2.0 roadmap, see ROADMAP.md.
The plugin uses a modular, class-based architecture for optimal maintainability:
Inline_Context_CPT(855 lines) - Custom Post Type registration, metaboxes, and admin UIInline_Context_Sync(496 lines) - Note usage tracking, reusable content synchronization, category syncInline_Context_Deletion(198 lines) - Bulk deletion with automatic cleanup from all postsInline_Context_REST_API(340 lines) - REST API endpoints for search, usage tracking, and note removal handlingInline_Context_Frontend(276 lines) - Noscript content generation, KSES filtering, asset enqueuingInline_Context_Taxonomy_Meta(372 lines) - Taxonomy meta fields for category icons, colors, and admin UI enhancementsInline_Context_Utils(182 lines) - Category management, CSS variable management with backward compatibility
inline-context.php(395 lines, down from 2,291) - Clean plugin initialization and class loadingadmin-settings.php(728 lines) - Admin settings UI with tabbed interface (function-based)
- Separation of Concerns: Each class has a single, well-defined responsibility
- Testability: Modular code is easier to unit test and debug
- Maintainability: 83% reduction in main file size makes codebase navigable
- Extensibility: Clean interfaces for adding features without touching core logic
- Performance: Efficient class initialization and lazy loading where appropriate
- Full keyboard navigation in icon picker (Esc to close, Tab/Shift+Tab to navigate)
- Keyboard activation of notes (Space/Enter on trigger links)
- Escape key closes tooltips and returns focus to trigger
- Automatic focus management for keyboard users (notes receive focus when opened)
- ARIA attributes on all interactive elements (
role="dialog",aria-modal,aria-label,aria-expanded) - Focus management (auto-focus on modal open, focus restoration on close)
- Focus trapping within modal dialogs
- Proper button semantics for icon selection
- Screen reader friendly labels on all icons and controls
- Notes include
role="note"attributes - Smart tooltip positioning ensures content stays within viewport
This plugin does not collect data, set cookies, or connect to external services.
- WordPress 6.0 or newer
- PHP 7.4 or newer
- Download from WordPress.org plugin directory
- Upload via Plugins → Add New in your WordPress admin
- Activate the plugin
composer config repositories.inline-context vcs https://github.com/jooplaan/inline-context
composer require jooplaan/inline-contextThis will install the plugin to wp-content/plugins/inline-context/ automatically using composer/installers.
- Download the latest release from GitHub
- Extract to
wp-content/plugins/inline-context/ - Activate via WordPress admin
-
Clone the repository
-
Install dependencies:
npm install composer install
-
Start development mode (watches files and rebuilds on change):
npm run start
-
Build for production:
npm run build
npm run start— Start development mode with hot reloadnpm run build— Build production assetsnpm run lint:js— Lint JavaScript filesnpm run lint:php— Check PHP coding standards (uses local PHPCS via Composer)npm run lint:php:fix— Auto-fix PHP coding standard violations (uses local PHPCBF via Composer)npm run lint— Check both JavaScript and PHP standardsnpm run test— Run all quality checks (currently linting)npm run pot— Show instructions for generating translation template file (requires WP-CLI)npm run package— Create a distributable zip (runs tests + build automatically)npm run release— Build and package in one step (runs tests + build automatically)
src/— Source files (JavaScript, SCSS)build/— Compiled assets (committed to repo for WordPress.org)languages/— Translation filesinline-context.php— Main plugin bootstrap fileadmin-settings.php— Admin settings interfaceincludes/— Modular class-based architecture (v2.0)readme.txt— WordPress.org readmescripts/— Build and packaging scriptsvendor/— Composer dependencies (PHP CodeSniffer, WordPress Coding Standards)
This project enforces WordPress coding standards for both JavaScript and PHP:
- JavaScript: Uses
@wordpress/scriptswith ESLint for WordPress coding standards - PHP: Uses PHP_CodeSniffer 3.13.5+ with WordPress-Coding-Standards 3.2.0+ ruleset (installed via Composer)
- Automatic Quality Checks: All packaging and release commands automatically fix and check linting before building
The project uses local PHP CodeSniffer tools installed via Composer:
# Install PHP development tools
composer install
# Run PHPCS manually
vendor/bin/phpcs --standard=WordPress inline-context.php
# Run PHPCBF manually
vendor/bin/phpcbf --standard=WordPress inline-context.php# Check code quality
npm run test
# Fix auto-fixable issues
npm run lint:fix # Fixes both JS and PHP
npm run lint:js:fix # Fix JavaScript only
npm run lint:php:fix # Fix PHP only
# Package with automatic linting fixes and checks
npm run package # automatically runs: lint:fix → build → package
# Release workflow (same as package)
npm run release # automatically runs: lint:fix → build → package-
Code quality is automatic:
npm run releaseautomatically fixes linting issues before building -
Update version numbers in:
inline-context.php(plugin header and INLINE_CONTEXT_VERSION constant)package.json(version field)readme.txt(Stable tag and Changelog)composer.json(version field)
-
Build and package (includes automatic quality checks):
npm run release
This automatically runs:
- ✅ JavaScript linting (ESLint)
- ✅ PHP coding standards (PHPCS)
- ✅ Production build
- ✅ Zip packaging
-
Test the package: The distributable zip will be at
dist/inline-context.zip -
Commit and tag:
git add . git commit -m "Release version X.Y.Z" git tag vX.Y.Z git push origin main --tags
-
Deploy: Upload
dist/inline-context.zipto WordPress.org SVN (or use the zip for manual distribution)
Please use the support forum on WordPress.org once the plugin is published. We'll do our best to help.
GPL v2 or later.