Renders a copyright disclaimer with the current year. Implemented as a block variation of core/paragraph using Block Bindings.
| Property | Value |
|---|---|
| Namespace | prc-block/copyright |
| Category | text |
| Version | 0.1.0 |
| API Version | 3 |
This block does not register its own supports. It is a variation of core/paragraph and inherits all of that block's supports.
This block has no custom attributes. It works by registering a core/paragraph block variation with the following preset attributes:
| Attribute | Value |
|---|---|
content |
"© 20xx Pew Research Center" |
metadata.bindings.content.source |
"prc-platform/copyright" |
The content is dynamically replaced at render time via the block bindings API.
None specific. Inherits all core/paragraph styles.
None.
None. Can be placed anywhere a paragraph block can be used.
- Insert the Copyright Disclaimer block from the block inserter (it appears as a variation of the Paragraph block).
- No configuration is needed. The block automatically displays the current year via the block bindings system.
- The displayed text is always in the format:
© {current year} Pew Research Center.
In post_content, this is a standard paragraph with binding metadata:
<!-- wp:paragraph {"metadata":{"bindings":{"content":{"source":"prc-platform/copyright"}}}} -->
<p>© 20xx Pew Research Center</p>
<!-- /wp:paragraph -->The Copyright PHP class works differently from most blocks:
- It does not register a block type. Instead, it registers a block bindings source named
prc-platform/copyright. - The binding's
get_value_callbackreturns the string© {year} Pew Research Centerusinggmdate('Y')for the current year. - At render time, WordPress replaces the paragraph's content with the dynamically generated copyright string.
- The editor script is enqueued via
enqueue_block_editor_assetsto register thecore/paragraphvariation in the editor.
None. The copyright text is rendered server-side as static HTML.
core/paragraph— This block is a variation of the core paragraph block.