Commit 1: editorial image prompt + style-template setting (#146)

* Commit 1: editorial image prompt + style-template setting

Pivot the image pipeline from the single-panel comic style to a text-free
editorial scientific illustration, and replace the Style Suffix setting with
an editable Style Template setting. Commit 1 of the in-plugin editorial image
pipeline (no composer yet; pipeline otherwise unchanged).

- New constant PRAUTOBLOGGER_DEFAULT_IMAGE_STYLE_TEMPLATE (brief §7 editorial
  template with the single {{ topic_summary }} token).
- New setting prautoblogger_image_style_template (textarea) replaces the
  Style Suffix field; single-token validation on save (brief A5); old
  prautoblogger_image_style_suffix mirrored to _deprecated for one cycle and
  not deleted (one-time migration prautoblogger_migrated_style_template_v0160).
- REWRITER_SYSTEM_PROMPT now emits a 1-2 sentence editorial topic/mechanism
  summary as the SCENE (no comic gag), keeping the CAPTION line for the
  unchanged HTML-caption-below-image path; scene/caption parsing contract
  preserved.
- New PRAutoBlogger_Image_Template_Filler substitutes the scene into the
  template's {{ topic_summary }} slot across all three entry points; strips
  control chars + clamps length (A5); degrades safely on missing token or
  empty summary so a blank/token-only prompt is never sent to the provider
  (A5/A6).
- Version bump 0.15.1 -> 0.16.0 + CHANGELOG + ARCHITECTURE.md updates.

Agent-Session: image-editorial-commit1

* style: auto-fix PHPCS violations via phpcbf

---------

Co-authored-by: peptiderepo <peptiderepo@users.noreply.github.com>
This commit is contained in:
peptiderepo
2026-06-09 13:18:38 +07:00
committed by GitHub
parent a4f3b1832e
commit d00e746727
11 changed files with 335 additions and 60 deletions

View File

@@ -330,6 +330,11 @@ class PRAutoBlogger_Admin_Page {
if ( 'prautoblogger_image_model' === $option_name ) {
return $this->sanitize_image_model( (string) $value );
}
if ( 'prautoblogger_image_style_template' === $option_name ) {
// Multi-line template: validation + textarea-safe sanitisation
// (incl. the single-token check, brief A5) lives in the filler.
return PRAutoBlogger_Image_Template_Filler::sanitize_for_save( (string) $value );
}
return sanitize_text_field( (string) $value );
}