ai-checks.php
Validates automation edits and publication, checks stale revisions, and reports structural and content problems before committing a draft or publishing it.
Responsibility#
Validates automation edits and publication, checks stale revisions, and reports structural and content problems before committing a draft or publishing it.
This is an implementation reference for the released 0.9.13 module. Internal PHP helpers are not a compatibility promise for third-party callers. Prefer the documented REST, Abilities, theme, and filter contracts.
Related modules#
abilities, page-model, render, rest, sanitize, template-code, theme.
Function and method reference#
cantata_edit_ai_write_guard#
function cantata_edit_ai_write_guard( int $page_id, string $rev )
Refuse stale revisions and a fresh editing lock held by somebody else.
Implementation connections: cantata_edit_ai_can, cantata_edit_page_rev.
Source location: includes/ai-checks.php:7.
cantata_edit_ai_store_draft#
function cantata_edit_ai_store_draft( WP_Post $post, string $html, ?string $title = null ): array
Save sanitized page HTML as the ordinary Kindly Edit draft and record the tool responsible.
Implementation connections: cantata_edit_ai_source, cantata_edit_ai_via, cantata_edit_atomic, cantata_edit_drop_meta, cantata_edit_page_rev, cantata_edit_put_meta, cantata_edit_same_html, cantata_edit_sanitize_saved_content.
Source location: includes/ai-checks.php:23.
cantata_edit_ai_edit_page#
function cantata_edit_ai_edit_page( array $in )
Structured operations, applied atomically to the current draft.
Implementation connections: cantata_edit_ai_apply_ops, cantata_edit_ai_outline, cantata_edit_ai_source, cantata_edit_ai_store_draft, cantata_edit_ai_write_guard, cantata_edit_has_draft, cantata_edit_template_code_with_owner.
Source location: includes/ai-checks.php:55.
cantata_edit_ai_save_draft#
function cantata_edit_ai_save_draft( array $in )
Whole-page draft save for clients that deliberately work with markup.
Implementation connections: cantata_edit_ai_store_draft, cantata_edit_ai_write_guard, cantata_edit_atomic, cantata_edit_has_draft.
Source location: includes/ai-checks.php:69.
cantata_edit_ai_drop_draft#
function cantata_edit_ai_drop_draft( int $id )
Remove every piece of the page draft; a WP_Error if the database kept any of it. Run inside cantata_edit_atomic().
Implementation connections: cantata_edit_drop_meta.
Source location: includes/ai-checks.php:80.
cantata_edit_ai_discard_draft#
function cantata_edit_ai_discard_draft( array $in )
Discard only the page draft, with the same stale-revision protection as the editor.
Implementation connections: cantata_edit_ai_drop_draft, cantata_edit_ai_write_guard, cantata_edit_atomic, cantata_edit_page_rev.
Source location: includes/ai-checks.php:89.
cantata_edit_ai_check_page#
function cantata_edit_ai_check_page( array $in )
Problems which should be reviewed before a draft is published.
Implementation connections: cantata_edit_ai_can, cantata_edit_ai_children, cantata_edit_ai_classes, cantata_edit_ai_component_of, cantata_edit_ai_parse, cantata_edit_ai_path_map, cantata_edit_ai_source, cantata_edit_ai_styles_available, cantata_edit_ai_tag, cantata_edit_ai_words, cantata_edit_components, cantata_edit_link_state, cantata_edit_page_rev.
Source location: includes/ai-checks.php:99.
cantata_edit_ai_publish_page#
function cantata_edit_ai_publish_page( array $in )
Explicitly publish the saved draft after checks.
Implementation connections: cantata_edit_ai_check_page, cantata_edit_ai_drop_draft, cantata_edit_ai_write_guard, cantata_edit_atomic, cantata_edit_page_rev, cantata_edit_storage_error, cantata_edit_without_kses.
Source location: includes/ai-checks.php:162.
cantata_edit_ai_history#
function cantata_edit_ai_history( array $in )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_ai_can, cantata_edit_rest_history.
Source location: includes/ai-checks.php:201.
cantata_edit_ai_restore_version#
function cantata_edit_ai_restore_version( array $in )
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Implementation connections: cantata_edit_ai_write_guard, cantata_edit_page_rev, cantata_edit_rest_restore.
Source location: includes/ai-checks.php:209.