PRC's override/extension of the WordPress core/post-title block.
Block Namespace
prc-block/core-post-title
What PRC Customizes
- Adds
aria-level="1"for accessibility on the rendered title element - Adds
data-post-parent-idanddata-post-typedata attributes for styling hooks - Registers an "Essay Title" block style with larger font size
- Reduces font size for child post titles (non-page post types with a parent)
- Registers print engine callbacks for cover title styling
Supports Modifications
None.
Additional Attributes
None beyond core. Data attributes are added at render time via WP_HTML_Tag_Processor.
Available Styles
| Style Name | Label | Description |
|---|---|---|
essay-title | Essay Title | Sets font size to 48px with line-height: 1.2 |
Registered in PHP via register_block_style with inline CSS.
Style Overrides
File: style.scss
- Child post titles —
.wp-block-post-title[data-post-parent-id]:not([data-post-type="page"])usesvar(--wp--preset--font-size--h-two)font size, making child post titles display at h2 size instead of the default
Editor Enhancements
None. No editor script beyond style imports.
Frontend Interactivity
None. No view.js file.
PHP Rendering
File: class-core-post-title.php
register_assets(inithook) — registers style handle and callsregister_new_stylesregister_new_styles(inithook) — registers theessay-titleblock style with inline CSSregister_style(enqueue_block_assetshook) — enqueues the stylerender(render_blockfilter) — usesWP_HTML_Tag_Processorto:- Set
aria-level="1"on the title element - Set
data-post-parent-idif the post has a parent - Set
data-post-typeto the current post type
- Set
register_print_callbacks(prc_print_engine_register_block_callbackshook) — registers print styles for.print-engine-cover__titleat 65px/75px when the Print Engine registry class is available (class_existsguard)
Block Markup Example
<!-- Standard post title -->
<h2 class="wp-block-post-title" aria-level="1" data-post-type="post">
Research Report Title
</h2>
<!-- Child post title -->
<h2 class="wp-block-post-title" aria-level="1" data-post-parent-id="42" data-post-type="post">
Chapter Title
</h2>
<!-- Essay Title style -->
<h2 class="wp-block-post-title is-style-essay-title" aria-level="1" data-post-type="post">
Long-Form Essay Title
</h2>
Variations
None.