page-block
БесплатноБез исполняемых скриптовНе проверенBuild and push section-based pages using the Marketers Delight Page Block (`marketers-delight/page-block`) Gutenberg block with HTML, CSS, and optional JS in…
от wpgaurav★ 24 звезды на GitHubОб этом скилле
Page Block Skill
Build and push section-based pages using the Marketers Delight Page Block system (v7.0.0). Page Blocks are reusable HTML/CSS/JS/PHP sections stored in a custom database table (wp_md_page_blocks), embeddable via Gutenberg block picker, shortcode, or positioned on hooks site-wide.
What Is a Page Block?
A Page Block is a reusable content unit stored in wp_md_page_blocks with its own HTML, CSS, JS, and display conditions. It can be used in three ways:
- Gutenberg block — picked from the library in the Block Editor via
marketers-delight/page-block - Shortcode —
[page_block id="123"]or[page_block slug="hero-section"] - Positioned — hooked to a theme action (e.g.,
md_hook_before_header) and conditionally displayed site-wide
Database Schema
| Column | Type | Default | Purpose |
|---|---|---|---|
id |
bigint | AUTO_INCREMENT | Primary key |
title |
varchar(255) | '' |
Display name |
slug |
varchar(200) | '' |
Unique identifier |
status |
varchar(20) | 'publish' |
publish/draft/trash |
content |
longtext | — | HTML (or HTML + PHP) |
css |
longtext | — | Block CSS |
js |
longtext | — | Block JavaScript |
js_location |
varchar(10) | 'footer' |
footer or inline |
output |
varchar(10) | 'inline' |
inline or file |
php_exec |
tinyint(1) | 0 |
Execute PHP in content |
format |
tinyint(1) | 0 |
Apply wpautop() |
position |
varchar(100) | '' |
Theme hook name (empty = no auto-placement) |
priority |
int(11) | 10 |
Hook priority |
conditions |
longtext | NULL |
JSON display conditions |
author |
bigint(20) | 0 |
Creator user ID |
created_at |
datetime | CURRENT_TIMESTAMP | Creation time |
updated_at |
datetime | CURRENT_TIMESTAMP | Last update time |
Gutenberg Block Reference Format
When embedded via the Block Editor, the block comment references by ID:
<!-- wp:marketers-delight/page-block {"blockId":1} /-->
<!-- wp:marketers-delight/page-block {"blockId":50} /-->
Key details:
- Self-closing block: ends with
/-->(no inner blocks) blockIdreferenceswp_md_page_blocks.id- All content/CSS/JS lives in the database, not in the block comment
- The block has
save: function() { return null; }— all rendering is server-side
Inline Page Block Format
For pages where content/CSS/JS should live directly in the post content (not in the database), use the inline-page-block block type:
<!-- wp:marketers-delight/inline-page-block {"content":"<section>...</section>","css":".class{css:value;}","js":"function (){}"} /-->
Key details:
- Block name:
marketers-delight/inline-page-block(NOTpage-block) - Self-closing block: ends with
/-->(no inner blocks) - All content/CSS/JS is JSON-encoded in the block comment attributes
content: HTML string (JSON-escaped)css: CSS string (JSON-escaped)js: JavaScript string (JSON-escaped, optional)- No
blockId— everything is inline in the post content - Ideal for programmatic/templated pages (e.g., local SEO city pages) where each page needs unique content
- Can be mixed with database-backed
page-blockreferences on the same page
When to use inline vs database:
- Database (
page-blockwithblockId): Shared sections reused across many pages (edit once, update everywhere) - Inline (
inline-page-block): Unique per-page content, programmatic generation, templated pages
Python Pattern for Inline Page Blocks
import json
def inline_page_block(content, css, js=""):
"""Build an inline-page-block comment"""
obj = {"content": content, "css": css}
if js:
obj["js"] = js
return '<!-- wp:marketers-delight/inline-page-block ' + json.dumps(obj, ensure_ascii=False) + ' /-->'
# Build a page with multiple inline blocks
blocks = [
inline_page_block('<section class="hero">...</section>', '.hero { background: #000; }', '(function(){})();'),
inline_page_block('<section class="services">...</section>', '.services { padding: 4rem 0; }'),
]
page_content = "\n\n".join(blocks)
New blocks should use the database blockId reference format for shared content, and inline-page-block for per-page unique content.
How It Renders
CSS Delivery
- On
template_redirect, positioned blocks are queried and their CSS collected - During
the_content, Gutenberg page blocks render and add their CSS - All CSS is combined and output in
<head>as<style id="md-page-blocks-css"> - File output mode: generates
/wp-content/uploads/md-page-blocks/page-blocks-v{version}.css
HTML Rendering
- If
php_execis true ANDMD_ALLOW_PHP_SNIPPETSis defined truthy inwp-config.phpAND the storedphp_checksummatchesmd5($content)at render time, PHP is executed via temp file include. Otherwise<?php … ?>blocks are stripped (HTML between tags is preserved, which is misleading — see "PHP ex
Установить page-block в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл page-block?
Build and push section-based pages using the Marketers Delight Page Block (`marketers-delight/page-block`) Gutenberg block with HTML, CSS, and optional JS in block attributes. Use when creating or updating WordPress pages that use Page Blocks and when generating or pushing Page Block content through the REST API.
Как установить скилл page-block?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл page-block запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic