Partials and blocks

The authoring commands for components. Global options and exit codes are on the CLI reference index; the authoring model itself is on Partials and Blocks.

wonderpress partial create

Scaffolds a PHP class, view template, manifest, and a delegated Static Kit style stub. Run it with no flags for the wizard; any flags you pass pre-answer its questions.

FlagDescription
--name <Class_Name>PHP class name. A positional name works too (partial create Hero). Omit both for the wizard.
--json <@file|string>Create from a JSON spec instead of flags.
--prop <name:type[:required]>Property (repeatable). Types: string, boolean, email, select, image, link, post_object, repeater, partial.
--sub <parent:name:type[:required]>Repeater sub-field (repeatable). Allowed sub-types: boolean, email, image, link, partial, select, string.
--acfMark ACF-compatible. Cannot combine with --no-manifest.
--blockAlso emit a Gutenberg wrapper (block.json plus a delegating render.php).
--jsAlso scaffold a JS behavior class (delegated to Static Kit).
--template-name <name.php>View template filename.
--no-templateSkip the view.
--no-styleSkip the SCSS stub.
--no-manifestSkip the manifest. Cannot combine with --block or --acf.

--js --no-template emits no behavior class. --block and --acf may be combined (a dual partial); do not locate the ACF group on a page that also inserts the block.

code
wonderpress partial create --name Testimonial --prop quote:string:requiredwonderpress partial create --name Hero --block --jswonderpress partial create --name Testimonials --acf \  --prop items:repeater --sub items:quote:string:required

wonderpress partial list

List every partial (name, slug, wrapping block if any), indexed from .wonderpress/manifest/partials/*.json. Blocks the CLI did not write show as (no manifest).

wonderpress partial sync [<Name>]

Regenerate the class $_properties and block.json from the manifest after editing properties in JSON.

FlagDescription
--allSync every partial in the theme.
--slug <slug>Address by slug instead of class name.
--dry-runPrint what would be written.
--properties-onlyUpdate class and block.json only (skip render.php).

wonderpress partial check-drift [<Name>]

Fail if a class or block.json has drifted from its manifest. Use in CI; repair with partial sync. Supports --all and --format json.

wonderpress partial add-js [<Name>]

Scaffold a JS behavior class onto an existing partial that has a view and no script. With no name, pick from eligible partials. The file is not auto-imported; wire it from the page JS entry that renders the partial.

wonderpress partial remove [<Name>]

Remove a partial and every artifact its manifest records, then the manifest. Accepts a class name (Call_To_Action) or slug (call-to-action). Refused while a block wraps the partial: run block remove first, or pass --with-block.

wonderpress partial install-manifest <slug>

Copy a core primitive manifest (for example link) into .wonderpress/manifest/partials/.

wonderpress block create [<Name>]

Add a Gutenberg wrapper to an existing partial. Output matches partial create --block. With no name, pick from partials that do not yet have a block.

wonderpress block list / wonderpress block remove [<Name>]

List blocks and the partials behind them. Remove deletes the block directory and strips it from the manifest; the partial stays.