// 1 START: Admin Page — Settings + Actions + Self-check (calls helpers below) if (!defined('ABSPATH')) { exit; } function gmm_temp_admin_page() { if (!current_user_can('manage_options')) { return; } // Handle actions first (messages shown at top) $action_msg = ''; if (isset($_POST['gmm_temp_action'])) { if ($_POST['gmm_temp_action'] === 'create_posts') { $action_msg = gmm_temp_action_create_posts(); } elseif ($_POST['gmm_temp_action'] === 'gen_folder_images') { $action_msg = gmm_temp_action_generate_folder_images(); } } $root = get_option(GMM_TEMP_OPT_ROOT, ''); $phid = (int) get_option(GMM_TEMP_OPT_PLACEHOLDER, 0); $font_opt = get_option('gmm_temp_font_path', ''); echo '
Status: Tools to preview, create/update draft posts, and generate folder images.
'; if ($action_msg) { echo ''.wp_kses_post($action_msg).'
Creates or updates draft posts (title “{Folder} Media”, slug “{folder}-media”), assigns the folder sub-category only, adds a matching tag, and sets a featured image if available.
'; echo ''; echo 'Overwrites {folder}.jpg
in each first-level folder (size auto-detected from your Featured/Large image). Uses TTF text if a font path is provided or auto-detected, else bitmap fallback.