'', ], $atts, 'aiaas_publish'); if (!is_user_logged_in()) { $login_url = wp_login_url(self::current_url()); return '
'.esc_html(self::t('auth.login_required_portal','You must be logged in to access AI Authors Studio.')).'
' . esc_html(self::t('publish.export_ready','Export ready.')) . ' ' . esc_html(self::t('publish.download_should_start','Your download should start automatically.')) . '
'; echo ''.esc_html(self::t('publish.download_export','Download Export')).'
'; echo ''.esc_html(self::t('publish.if_not_start','If it doesn\'t start, click the button above.')).'
'; echo '' . esc_html(self::t('publish.download_label','Download:')) . '
'; echo ''.esc_html(self::t('publish.download_export','Download Export')).'
'; echo ''.esc_html(self::t('publish.select_project','Select a project to publish:')).'
'; $projects = self::query_projects(0); if (!$projects) { echo '' . wp_kses_post(self::t('publish.no_projects_yet','No projects yet. Use [aiaas_projects] to create one first.')) . '
'; echo '' . wp_kses_post(self::t('publish.lock_project_tip_html','Tip: Use [aiaas_publish project_id="123"] to lock an export page to one project.')) . '
'.esc_html(self::t('dashboard.select_project','Select a project to continue (or manage projects below).')).'
'; self::render_projects_overview_frontend(0); echo ''.esc_html(self::t('common.project_not_found','Project not found or you do not have access.')).'
'; return ob_get_clean(); } // Remember last project for quick-return workflows. self::set_last_project_id($project_id); // Single project/workspace bar (selector + samples) self::render_project_bar_frontend($project_id, []); $project = get_post($project_id); $chapters = self::query_chapters($project_id); $publish_url = self::portal_url_with_context('publish', ['project_id' => (int) $project_id]); $word_count = 0; foreach ($chapters as $ch) { $word_count += str_word_count(wp_strip_all_tags((string)$ch->post_content)); } // Overview block removed (it could display stale project info on Publish). $uid_plan = (int) get_current_user_id(); $plan_tier = \AIAAS\Entitlements::get_user_plan_tier($uid_plan); $is_studio = in_array($plan_tier, ['studio','whitelabel'], true); $is_pro_plus = in_array($plan_tier, ['pro','studio','whitelabel'], true); // FREE baseline cleanup: Publish Readiness Checklist and Page Numbering sections removed. // Formatting & Layout (Publish) — removed in FREE baseline $formatting_block = ''; // Layout note: // Avoid relying on inline