Linux 软件免费装
Banner图

Post Formats for Block Themes

开发者 courane01
更新时间 2026年8月21日 05:44
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

block-editor patterns post-formats block-theme chat-log

下载

1.0.0 1.1.0 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 2.3.0

详情介绍:

Post Formats for Block Themes brings the beloved post format functionality from classic WordPress themes to modern block themes, with intelligent pattern insertion, automatic format detection, and a streamlined editing experience that makes creating formatted content effortless. Why Post Formats Matter for Block Themes WordPress post formats have been a powerful feature since WordPress 3.1, allowing content creators to style different types of posts distinctively—quotes appear with enhanced typography, galleries showcase images prominently, status updates feel like social media, and chat transcripts display conversations beautifully. However, with the shift to block themes and Full Site Editing, this functionality was left behind. Post Formats for Block Themes solves this problem. This plugin brings post formats into the block editor era with format-specific block patterns, automatic content detection, and accessibility-first design. Whether you're building a personal blog, portfolio, news site, or creative magazine, post formats help your content stand out. Who This Plugin Is For Key Features 10 Format-Specific Block Patterns Each WordPress post format gets a professionally-designed block pattern optimized for its content type. Patterns include locked first blocks to maintain format consistency while giving you complete creative freedom for additional content: Integrated Chat Log Block No separate plugin needed! Post Formats for Block Themes includes a full-featured Chat Log block for displaying conversation transcripts. Perfect for interviews, customer support examples, team discussions, or any dialogue format. Supported platforms: Slack, Discord, Microsoft Teams, WhatsApp, Telegram, Signal, and generic chat transcripts. Additional text format support: SRT subtitles, VTT captions, and plain text exports from any chat application. Chat Log features: automatic platform detection, avatar display, timestamp formatting (relative, absolute, time-only), multiple display styles (bubbles, IRC, transcript, timeline), thread collapsing, participant lists, device frames, full accessibility, and RTL support. Automatic Format Detection Save time with intelligent format detection. The plugin analyzes your post's first block and automatically assigns the appropriate format. Gallery block becomes Gallery format, video block becomes Video format, quote block becomes Quote format, and so on. Detection runs on post save and respects manual format selections. Format Selection Modal When creating a new post, a visual format selection modal appears with all 10 formats displayed as cards showing icons, names, descriptions, and use cases. Fully keyboard accessible and screen reader friendly. Format Switcher Sidebar Panel Change formats mid-edit with the Format Switcher in the post sidebar. View current format, see auto-detection suggestions, choose to replace content or keep existing blocks. Perfect for when you change your mind about post type. Status Format Validation The Status format includes Twitter-style character validation with real-time counter, 280-character soft limit, visual feedback, accessibility announcements, and mobile-friendly composition. Post Format Repair Tool Scan existing posts and fix format mismatches with the built-in repair tool (Tools → Post Format Repair). Detects content/format mismatches, bulk or individual repairs, preview suggestions, one-click fixes. Perfect for migrating from classic themes. Theme-Agnostic Styling Format styles integrate seamlessly with any block theme using CSS custom properties from your theme.json. Respects your theme's colors, typography, spacing. No styling conflicts. Works with Global Styles. How to Use Post Formats in Block Themes Creating Your First Formatted Post:
  1. Navigate to Posts → Add New
  2. Format selection modal appears automatically
  3. Click your desired format (e.g., "Quote")
  4. Pattern is inserted with locked first block
  5. Add content within the pattern
  6. Publish your formatted post Mid-Edit Format Switching:
  7. Open the right sidebar while editing
  8. Find the "Format Switcher" panel
  9. Choose a new format from dropdown
  10. Decide to replace or keep content
  11. Format updates instantly Using Auto-Detection:
  12. Start a new post without selecting a format
  13. Add content (e.g., insert a gallery block)
  14. Save as draft or publish
  15. Plugin automatically detects Gallery format
  16. Format is assigned without manual action
How to Create a Quote Post Showcase quotations and citations beautifully:
  1. Select Quote format from the modal
  2. The pullquote pattern loads with locked Quote block
  3. Type or paste your quote
  4. Add attribution in citation field
  5. Optional: Add commentary below the quote
  6. Customize styling via Global Styles
  7. Publish your enhanced quote post
The locked pullquote maintains format integrity while allowing unlimited additional content blocks. How to Display Chat Conversations Turn conversation transcripts into readable, attractive content:
  1. Select Chat format when creating new post
  2. Chat Log block inserts automatically
  3. Copy conversation text from Slack, Discord, Teams, WhatsApp, etc.
  4. Paste into Chat Log block—platform detection is automatic
  5. Configure display options: style, avatars, timestamps, threads, device frame
  6. Preview the formatted conversation
  7. Publish your beautiful chat transcript
Platform-specific features: Slack preserves channels, threads, reactions; Discord maintains server structure and roles; Teams retains meeting context; WhatsApp shows message status and reply chains; Telegram preserves stickers; Signal maintains message indicators. How to Automatically Detect Post Formats Let the plugin handle format assignment:
  1. Create new post without selecting format
  2. Add content normally (gallery, video, quote, etc.)
  3. Save draft or publish—detection runs on save
  4. Check Format Switcher panel for detected format
  5. Accept or manually override
Detection rules: first block determines format. Gallery block = Gallery format, Video block = Video format, Quote block = Quote format, and so on. Detection only runs on posts without manual format selection. How to Repair Mismatched Formats Fix format assignments across your entire site:
  1. Navigate to Tools → Post Format Repair
  2. Click "Scan All Posts"—analyzes content vs. formats
  3. Review mismatch report
  4. Preview suggestions for each post
  5. Bulk repair all or fix individually
  6. Verify changes
Common scenarios: migrating from classic themes, imported content, incorrect manual assignments, exploring your format distribution. The repair tool is safe—changes only format meta, never modifies post content. Migrating from Classic Theme Post Formats Preserve post format styling when switching to block themes: Before Migration:
  1. Install plugin on classic theme site
  2. Leave classic theme active
  3. Test repair tool with scan (don't apply yet)
  4. Review the report During Migration:
  5. Switch to block theme
  6. Activate Post Formats for Block Themes
  7. Visit Tools → Post Format Repair
  8. Run full scan
  9. Review suggestions
  10. Apply bulk repair After Migration:
  11. Check frontend display
  12. Customize styling in theme.json
  13. Create new posts with format patterns
  14. Optional: update old posts to use patterns What transfers: format assignments, post content, featured images, post meta. What changes: theme template styling becomes pattern styling, classic PHP templates become block templates. Tips: test on staging first, take database backup, check one post per format, customize theme.json colors, use patterns for new content.
Block Theme Compatibility Guide What Makes a "Block Theme": Block themes use block templates (.html files) and theme.json instead of PHP templates. Key characteristics: templates/ folder with .html files, theme.json file, Full Site Editing support, activated via Appearance → Themes. Learn more in the WordPress Block Theme documentation. Why Classic Themes Aren't Supported: Classic themes use PHP template files which conflict with block-based patterns. This plugin requires block pattern support, block templates, theme.json styling, and block editor integration. If you prefer using a classic theme with post format support, consider using the Twenty Thirteen theme which includes excellent built-in post format styling. Recommended Compatible Block Themes: Twenty Twenty-Five, Twenty Twenty-Four, Twenty Twenty-Three, Block themes from Automattic (Blank Canvas, Pendant), most modern block themes on WordPress.org. Theme.json Integration: The plugin reads color palette, typography, spacing, and border styles from your theme.json. Format styles automatically adapt. To customize, edit your theme.json color and typography settings. Developer Guide: Extending Post Formats Add Custom Format: php add_filter( 'pfbt_registered_formats', function( $formats ) { $formats['review'] = [ 'name' => 'Review', 'description' => 'Product review', 'icon' => 'star-filled', 'pattern_slug' => 'my-theme/review-pattern', ]; return $formats; } ); Custom Detection Logic: php add_filter( 'pfbt_detected_format', function( $format, $first_block, $all_blocks ) { if ( $first_block['blockName'] === 'my-plugin/custom-block' ) { return 'gallery'; } return $format; }, 10, 3 ); Run Code After Detection: php add_action( 'pfbt_format_detected', function( $post_id, $format, $post ) { error_log( "Post {$post_id} detected as {$format}" ); }, 10, 3 ); Track Format Changes: php add_action( 'pfbt_format_changed', function( $post_id, $old_format, $new_format ) { // Analytics tracking }, 10, 3 ); More filters and actions available for pattern content modification, post-repair actions, and format definition customization.

安装:

Minimum Requirements Automatic Installation
  1. Log in to WordPress admin
  2. Navigate to Plugins → Add New
  3. Search for "Post Formats for Block Themes"
  4. Click "Install Now" then "Activate"
  5. Create a new post—format selection modal will appear
Manual Installation
  1. Download plugin ZIP from WordPress.org
  2. Go to Plugins → Add New → Upload Plugin
  3. Choose ZIP file and click "Install Now"
  4. Click "Activate Plugin"
  5. Create a new post to start using formats
After Activation
  1. Create test post (Posts → Add New)
  2. See format modal with all 10 formats
  3. Choose a format to insert its pattern
  4. Add content within pattern structure
  5. Publish your formatted post
  6. Optional: Run repair tool (Tools → Post Format Repair)

屏幕截图:

  • Format Switcher sidebar panel showing current format, auto-detection status, and dropdown to switch formats mid-edit
  • Quote format pattern with locked pullquote block, attribution field, and enhanced typography adapting to theme
  • Chat Log block displaying Slack conversation with avatars, usernames, timestamps, and bubble-style formatting
  • Post Format Repair tool showing scan results, detected mismatches, suggested format changes, and one-click repair
  • Status format editor with real-time 280-character counter, validation, and visual feedback like social media
  • Automatic format detection notification suggesting Quote format after inserting pullquote block
  • Gallery format pattern with locked gallery block displaying responsive grid layout adapting to theme columns

升级注意事项:

2.0.0 Major release — breaking change. Establishes a hard plugin/theme styling contract: plugin owns layout, theme owns paint. Sites that customized via --wp--preset--color--format-* tokens must rename to --pfbt-format-*. Sites that did not customize see no visible change. Pattern slugs pfpu/{format} deprecated in favor of pfbt/{format}-archive and pfbt/{format}-single. See THEME-INTEGRATION.md before upgrading on heavily customized sites. 1.2.5 Important fix: Resolves homepage / page / archive resolution rendering with single.html markup on heavily-themed sites. Recommended for any site that has its own front-page or page templates and saw post-title, author byline, or related-posts sections leaking onto non-post pages. 1.2.4 Adds pfbt_register_format_templates opt-out filter for themes that ship their own template hierarchy. Stop-gap for the bug fixed properly in 1.2.5. 1.2.3 Adds pfbt_enqueue_format_styles and pfbt_merge_format_palette opt-out filters. Useful for themes with bespoke palettes that don't want the plugin's stock Gutenberg defaults appearing in the color picker or fighting .format-X body-class styling. 1.2.2 Release marker: forces Git Updater to detect an update on installs that pulled v1.2.1 before commit 8daf545 added the activitypub and post-kinds include files. Resolves a fatal in pfbt_include_files() for affected installs. 1.2.0 Major feature release: Adds WordPress Abilities API integration for machine-readable post format operations. Requires WordPress 6.9+. Includes feature flags system for future IndieWeb, MCP, and ActivityPub integrations. 1.1.4 Critical fix: Resolves issue where plugin's theme.json was overriding theme layout settings and causing blank templates. All users should upgrade immediately. 1.1.3 Critical performance fix: Resolves database performance issue with revision queries. Also fixes duplicate pattern insertion, character counter appearing twice, and JavaScript errors. Simplified patterns for cleaner editing. All users should upgrade. 1.1.2 Editor UI improvements: Simplified format selection, better template chooser, fixed standard posts incorrectly showing format templates. 1.1.1 Critical fix: Format templates no longer appear in Template dropdown, fixing template selection issues. 1.1.0 Major update: Adds Post Format Block for frontend display, post format admin column with filtering, template improvements with category/tag/format display, and critical bug fixes for template assignment. All users should upgrade. 1.0.0 Initial release of Post Formats for Block Themes. Requires WordPress 6.8+ and a block theme. Includes integrated Chat Log block—no separate plugin needed. Full WCAG 2.2 AA accessibility compliance.

常见问题:

Does this work with classic themes?

No, this plugin requires block themes with Full Site Editing. Classic themes use PHP templates incompatible with block patterns. This plugin requires block theme with theme.json, block templates in templates/ folder, and WordPress 6.9+. Consider migrating to a modern block theme like Twenty Twenty-Five.

Will this work with my existing posts?

Yes! Use Post Format Repair Tool (Tools → Post Format Repair) to scan existing posts and automatically detect appropriate formats based on content. Tool analyzes first block and suggests matching format. Review before applying repairs. Tool only changes format assignments—never modifies actual content.

What happens if I deactivate the plugin?

Content remains safe: format assignments stay in database, pattern blocks remain as standard blocks, Chat Log blocks show as "unsupported block" (content preserved), no data lost. If you reactivate, all functionality returns immediately.

Can I customize the format patterns?

Yes, multiple ways:

  • Use filters in functions.php to modify pattern HTML
  • Register custom patterns to override defaults
  • Edit blocks after insertion (locked first block maintains consistency)
  • Use Global Styles to change colors, typography, spacing

Does the Status format prevent publishing over 280 characters?

No, 280-character limit is a soft suggestion, not a hard block. Shows real-time counter, visual warning when approaching limit, accessibility announcements, but you CAN publish longer status updates if needed.

What is the Bookmark Card integration?

Link format checks if the Bookmark Card plugin is installed. If active, uses bookmark-card blocks with rich previews, images, descriptions, automatic metadata fetching. If not installed, uses standard linked paragraphs. Both work perfectly—integration just enhances experience.

Does this work with podcasting plugins?

Yes! The Audio format integrates with the Podlove Podcasting Plugin for WordPress when installed. If Podlove is active, Audio format patterns can utilize Podlove's enhanced audio player and podcast metadata. Without Podlove, the plugin uses WordPress core audio blocks which work perfectly for standard audio content.

What about accessible media players?

The Video and Audio formats integrate with Able Player when installed. Able Player provides an accessible HTML5 media player with captions, audio descriptions, interactive transcripts, and full keyboard support. When Able Player is active, format patterns can utilize its enhanced accessible playback features. Without Able Player, the plugin uses WordPress core media blocks.

How do I use the Chat format?

You don't need a separate plugin! Post Formats for Block Themes includes integrated Chat Log block (chatlog/conversation). Chat format works out of the box, no additional plugins required. Just select Chat format and paste conversation transcripts from Slack, Discord, Teams, WhatsApp, Signal, or Telegram.

Can I change formats after creating a post?

Absolutely! Use Format Switcher in post sidebar. Open post in block editor, find Format Switcher panel in right sidebar, click format dropdown, choose new format, decide to replace or keep content, click Switch Format. Format updates immediately.

How does auto-detection know when NOT to change my format?

Auto-detection respects manual choices. Detection WILL run on: new posts without format selection, posts never explicitly formatted, programmatically created posts. Detection WON'T run on: manually selected formats, Format Switcher changes, posts with internal user-selected flag, Quick Edit manual formats. Once you choose manually, auto-detection defers to you.

Can I use this with WooCommerce or custom post types?

Yes! Register post format support for custom post types: php add_post_type_support( 'product', 'post-formats' ); // WooCommerce add_post_type_support( 'portfolio', 'post-formats' ); // Custom type Then formats and plugin features work for those types. Patterns and modal only appear in block editor.

Does this work with multisite?

Yes! Fully multisite compatible. Install network-wide or per-site, each site has independent format settings, repair tool scans only current site's posts, no database conflicts, pattern registration respects site context. For large networks, consider network activation.

更新日志:

2.3.0 WP 7.0 features, automatic format detection returns, and fixes across every format. 2.2.0 Added — 16 quote and pullquote block style variations. 2.1.0 Added — 36 image and gallery block style variations. 2.0.1 Added: Fixed: 2.0.0 Major release — format styling system. Twelve-session overhaul that establishes a hard contract between the plugin and consumer themes: plugin owns layout, theme owns paint. Every plugin reference to color or typography routes through var(--pfbt-format-X-*, NEUTRAL) tokens. This is a breaking change. Sites that customized via the old --wp--preset--color--format-* tokens must rename to the new --pfbt-format-* namespace. Sites that did not customize see no visible change after upgrading (most look better, since stock Gutenberg colors that fought brand palettes are gone). Highlights: Migration: See THEME-INTEGRATION.md for the full table of old → new token names. Pattern slugs pfpu/{format} are deprecated; use pfbt/{format}-archive or pfbt/{format}-single. Plugin's theme.json no longer ships palette entries — themes own the palette. 1.2.5 Fixed 1.2.4 Added add_filter( 'pfbt_register_format_templates', '__return_false' ); 1.2.3 Added add_filter( 'pfbt_enqueue_format_styles', '__return_false' ); add_filter( 'pfbt_merge_format_palette', '__return_false' ); 1.2.2 Fixed 1.2.1 Fixed 1.2.0 New Features Requirements Developer 1.1.4 - 2025-12-19 Bug Fixes Changes 1.1.3 - 2025-12-18 Performance New Features Bug Fixes Improvements Security 1.1.2 - 2025-12-11 New Features Improvements Bug Fixes Technical Changes 1.1.1 - 2025-12-09 Bug Fixes 1.1.0 - 2025-12-08 New Features Improvements Bug Fixes Code Quality Developer 1.0.0 - 2025-01-XX Initial Release