Depends on Twenty-Bellows/patternbuilderwp.com#29, which adds the license field to pbp/1.
Why
A pattern installed from the cloud today carries no licence information anywhere. Pattern_File_Store writes Title, Slug, Description, Categories, Keywords, Block Types, Post Types, Template Types, Viewport Width, Inserter, Synced and Origin — and nothing about terms. A grep for license across this plugin returns only Freemius billing identifiers.
That matters most in the case the pattern is most likely to end up in: a designer downloads a pattern, it lands in patterns/{handle}/{collection}/{slug}.php, and the theme is distributed. GPLv2 §1 requires the notice to travel with the copy, and right now nothing does.
The precedent is already set by Origin: — as the architecture notes put it, "it travels in the file because it has to survive a theme being distributed." The licence has a stronger claim to that treatment than the origin does.
Scope
Theme patterns. One line in the header block built at includes/class-pattern-file-store.php:445-462, beside $origin:
$license = $pattern->license ? "\n * License: " . $pattern->license : '';
Conditional in the same way, so a pattern with no licence — a local one that never came from the cloud — is written exactly as it is today and no existing file churns.
User patterns. Post meta, mirroring how Origin: is handled for wp_block destinations, so both install destinations carry it.
Read it back. The header has to parse on read as well as write, so a re-upload or a round trip does not drop it, and so the UI issue has something to display.
Caveat worth recording
Once the file sits inside a distributed theme, the theme's own style.css and readme.txt arguably cover it, which makes this belt-and-braces rather than strictly required. It earns its place for the case where a pattern file moves between themes or sites on its own, where nothing else states the terms. Not a reason to skip it, but a reason not to over-build it.
Acceptance criteria
Depends on Twenty-Bellows/patternbuilderwp.com#29, which adds the
licensefield topbp/1.Why
A pattern installed from the cloud today carries no licence information anywhere.
Pattern_File_StorewritesTitle,Slug,Description,Categories,Keywords,Block Types,Post Types,Template Types,Viewport Width,Inserter,SyncedandOrigin— and nothing about terms. A grep forlicenseacross this plugin returns only Freemius billing identifiers.That matters most in the case the pattern is most likely to end up in: a designer downloads a pattern, it lands in
patterns/{handle}/{collection}/{slug}.php, and the theme is distributed. GPLv2 §1 requires the notice to travel with the copy, and right now nothing does.The precedent is already set by
Origin:— as the architecture notes put it, "it travels in the file because it has to survive a theme being distributed." The licence has a stronger claim to that treatment than the origin does.Scope
Theme patterns. One line in the header block built at
includes/class-pattern-file-store.php:445-462, beside$origin:Conditional in the same way, so a pattern with no licence — a local one that never came from the cloud — is written exactly as it is today and no existing file churns.
User patterns. Post meta, mirroring how
Origin:is handled forwp_blockdestinations, so both install destinations carry it.Read it back. The header has to parse on read as well as write, so a re-upload or a round trip does not drop it, and so the UI issue has something to display.
Caveat worth recording
Once the file sits inside a distributed theme, the theme's own
style.cssandreadme.txtarguably cover it, which makes this belt-and-braces rather than strictly required. It earns its place for the case where a pattern file moves between themes or sites on its own, where nothing else states the terms. Not a reason to skip it, but a reason not to over-build it.Acceptance criteria
License:written for a cloud-installed theme patternwp_blockdestinationnpm run test:php(or the SQLite fallback) passes