admin_url( 'admin-ajax.php' ), 'adminUrl' => admin_url(), 'siteUrl' => home_url( '/' ), 'modelsNonce' => wp_create_nonce( 'prautoblogger_get_models' ), 'imageModels' => PRAutoBlogger_Settings_Fields_Extended::get_image_models(), ) ); // M3: localize preview + history + diff nonces for pipeline-settings.js. wp_localize_script( 'prautoblogger-pipeline', 'prabPipeline', array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'previewAction' => PRAutoBlogger_Pipeline_Preview_Handler::ACTION, 'previewNonce' => wp_create_nonce( PRAutoBlogger_Pipeline_Preview_Handler::ACTION ), 'historyAction' => PRAutoBlogger_Pipeline_History_Handler::ACTION_HISTORY, 'historyNonce' => wp_create_nonce( PRAutoBlogger_Pipeline_History_Handler::ACTION_HISTORY ), 'diffAction' => PRAutoBlogger_Pipeline_History_Handler::ACTION_DIFF, 'diffNonce' => wp_create_nonce( PRAutoBlogger_Pipeline_History_Handler::ACTION_DIFF ), ) ); } /** * Render the Pipeline Settings page. * * Capability check first; then delegate to the save handler (processes * POST before output starts) and the renderer (assembles view data and * includes the template). * * @return void */ public function render_page(): void { if ( ! current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You do not have permission to access this page.', 'prautoblogger' ) ); } $save_result = PRAutoBlogger_Pipeline_Settings_Save_Handler::maybe_process_save(); $renderer = new PRAutoBlogger_Pipeline_Settings_Renderer(); $renderer->render( $save_result ); } }