wordpress-blocks

Create WordPress Gutenberg blocks with PHP render callbacks and register_block_type.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/oiler/claude-skills --skill wordpress-blocks-oiler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wordpress-blocks
Source: https://github.com/oiler/claude-skills/tree/main/wordpress-blocks
Command: npx skills add https://github.com/oiler/claude-skills --skill wordpress-blocks-oiler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

WordPress block development often requires a clear separation between editors who control content and developers who control layout and design. This Skill provides a structured approach to building Gutenberg blocks with server-side PHP rendering, ensuring secure output, consistent behavior, and reusability across themes.

Core Features & Use Cases

  • Block file structure patterns (PHP registration file, JS editor file, optional CSS).
  • Server-side render with proper escaping and sanitization to ensure security and consistent output.
  • Media upload integration for blocks with images.
  • Support for single and multiple item blocks with consistent data attributes.
  • Editor UI patterns and best practices for maintainability and UX.

Quick Start

Create a basic Gutenberg block by following the three-file pattern: PHP registration in inc/blocks/block-name.php, editor JavaScript at inc/blocks/js/block-name.js, and a render callback in PHP. Then register the block in functions.php and enqueue editor assets.

Frequently Asked Questions about wordpress-blocks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a WordPress Gutenberg block with server-side PHP rendering?

To create a Gutenberg block with server-side PHP rendering, you set up a three-file pattern: a PHP registration file, a JavaScript editor file, and a PHP render callback, then register the block via register_block_type and enqueue editor assets.

Why should I use server-side rendering instead of JavaScript for custom WordPress blocks?

Using server-side PHP rendering for WordPress blocks ensures secure output through proper sanitization and escaping. It separates editor content control from developer layout control, providing consistent behavior and maintainability across themes.

What is the best way to structure files for a custom Gutenberg block?

The best way to structure Gutenberg block files is using a dedicated pattern: place PHP registration in inc/blocks/block-name.php, editor JavaScript in inc/blocks/js/block-name.js, and include optional CSS, keeping assets safely managed.

Can I integrate media uploads into my custom WordPress blocks?

Yes, you can integrate media uploads into your custom WordPress blocks. The server-side rendering approach supports media upload integration for blocks with images, alongside consistent data attributes for both single and multiple item blocks.

Does this block development approach support both single and multi-item blocks?

Yes, this block development approach supports both single and multiple item blocks. It ensures consistent data attributes across both types, along with editor UI patterns and best practices for improved maintainability and user experience.