Article dossier (Proposal C): per-stage input/output sections w/ raw-trace toggle, metadata sidebar + per-stage cost receipt, run_decisions rationale, image section, metabox dossier link, board deep-links. DB-migration methods extracted to class-db-migrations.php (byte-parity verified by QA). QA: APPROVE-W-P2 qa-reviews/prautoblogger/2026-06-12-579c66e.md P2s carried to M3: populate request_json (input trace), sidebar pv consolidation, image stages in run_stages. Thread: pipeline-v2-phase2-admin seq 16-20 Agent-Session: cto-phase2-admin-m2-merge-20260612
57 lines
1.5 KiB
PHP
Executable File
57 lines
1.5 KiB
PHP
Executable File
<?php
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* phpcs:ignore WordPress.Files.FileName.InvalidClassFileName -- class naming convention differs from WordPress standard
|
|
*
|
|
* Adds a metabox to PRAutoBlogger-generated posts.
|
|
*
|
|
* M2: Slimmed to a "View generation dossier" link. Full generation metadata
|
|
* lives on the Article Dossier page (PRAutoBlogger_Dossier_Page).
|
|
*
|
|
* Triggered by: PRAutoBlogger::register_admin_hooks() on `add_meta_boxes`.
|
|
* Dependencies: PRAutoBlogger_Dossier_Page (for URL helper).
|
|
*
|
|
* @see class-prautoblogger.php -- Registers the hook.
|
|
* @see admin/class-dossier-page.php -- Dossier target; provides url_for_post().
|
|
* @see core/class-publisher.php -- Writes the run_id meta this class reads.
|
|
*/
|
|
class PRAutoBlogger_Post_Metabox {
|
|
|
|
/**
|
|
* Register the metabox for PRAutoBlogger-generated posts only.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function on_register_metabox(): void {
|
|
$screen = get_current_screen();
|
|
if ( ! $screen || 'post' !== $screen->id ) {
|
|
return;
|
|
}
|
|
|
|
global $post;
|
|
if ( ! $post || '1' !== get_post_meta( $post->ID, '_prautoblogger_generated', true ) ) {
|
|
return;
|
|
}
|
|
|
|
add_meta_box(
|
|
'prautoblogger_generation_info',
|
|
__( 'PRAutoBlogger', 'prautoblogger' ),
|
|
array( $this, 'render_metabox' ),
|
|
'post',
|
|
'side',
|
|
'default'
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Render the dossier-link metabox.
|
|
*
|
|
* @param \WP_Post $post Current post.
|
|
* @return void
|
|
*/
|
|
public function render_metabox( \WP_Post $post ): void {
|
|
include PRAUTOBLOGGER_PLUGIN_DIR . 'templates/admin/metabox-dossier-link.php';
|
|
}
|
|
}
|