A collection of WordPress plugins demonstrating how to extend core blocks using the Interactivity API, prepared for WordCamp presentations in 2025.
This repository contains three WordPress plugins that showcase different approaches to extending WordPress core blocks with interactive functionality using the WordPress Interactivity API:
- Word Switcher Core Blocks - Adds dynamic word switching functionality to paragraph and heading blocks
- IAPI Gallery Slider - Creates an interactive gallery slider block with autoplay and navigation features
- IAPI Core Blocks Inner Blocks - Extends core button and video blocks with interactive play/pause functionality
- WordPress 6.4+ (6.7+ recommended for Word Switcher)
- PHP 7.4+
- Node.js 16+ and npm
- WordPress development environment (Local, wp-env, etc.)
git clone https://github.com/yourusername/wcv2025-extending-core-blocks-iapi.git
cd wcv2025-extending-core-blocks-iapiEach plugin needs to be built separately:
cd word-switcher-core-blocks
npm install
npm run buildcd ../iapi-gallery-slider
npm install
npm run buildcd ../iapi-core-blocks-inner-blocks
npm install
npm run build- Copy each plugin folder to your WordPress
/wp-content/plugins/directory - Navigate to WordPress Admin → Plugins
- Activate the desired plugins
Each plugin can be developed independently with hot reloading:
cd [plugin-directory]
npm startnpm run build- Build the plugin for productionnpm start- Start development server with hot reloadingnpm run format- Format code using WordPress coding standardsnpm run lint:js- Lint JavaScript filesnpm run lint:css- Lint CSS filesnpm run plugin-zip- Create a distributable ZIP file
The Word Switcher plugin includes wp-env configuration:
npm run env:start- Start WordPress development environmentnpm run env:stop- Stop the environmentnpm run env:destroy- Remove the environmentnpm run env:reset- Reset the environment
Extends paragraph and heading blocks to add dynamic word switching functionality. Words cycle through a comma-separated list with fade transitions.
Key Features:
- Format type registration for block editor
- Server-side rendering with HTML Tag Processor
- Smooth fade transitions between words
- Works with paragraph and heading blocks
Creates an interactive gallery slider that works with cover, image, and media-text blocks.
Key Features:
- Autoplay functionality
- Continuous/infinite loop option
- Customizable transition speed
- Navigation controls
- Slide counter display
Demonstrates extending core blocks with interactive controls.
Key Features:
- Adds play/pause functionality to video blocks
- Creates interactive buttons for media control
- Uses WordPress Interactivity API for state management
- Seamless integration with existing blocks
- WordPress Interactivity API - For creating interactive frontend experiences
- WordPress Block Editor (Gutenberg) - For block development
- @wordpress/scripts - Build tooling and scripts
- PHP HTML Tag Processor - For server-side HTML manipulation
- ES Modules - Modern JavaScript module system
Contributions are welcome! Please feel free to submit issues and pull requests.
All plugins are licensed under GPL-2.0-or-later.
The WordPress Contributors
These plugins were created as demonstration materials for WordCamp presentations about extending WordPress core blocks with the Interactivity API.