if (!function_exists('jjsp_admin_page')) : function jjsp_admin_page() { if (!current_user_can('edit_posts')) { wp_die('권한이 없습니다.'); } // 안전하게 옵션 가져오기 $opts = function_exists('jjsp_get_options') ? jjsp_get_options() : []; if (!is_array($opts)) { $opts = []; } $palette = (isset($opts['palette']) && is_array($opts['palette'])) ? $opts['palette'] : array_fill(0, 10, ''); $presets = (isset($opts['presets']) && is_array($opts['presets'])) ? $opts['presets'] : []; $auto_enabled = !empty($opts['auto_enabled']); $auto_multi = !empty($opts['auto_multi']); $auto_rules = isset($opts['auto_rules']) ? (string)$opts['auto_rules'] : ''; // POST 처리 (권한/nonce 확인) if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['jjsp_action'])) { if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], 'jjsp_smart_paste')) { wp_die('보안 토큰이 유효하지 않습니다.'); } if (function_exists('jjsp_handle_post_actions')) { jjsp_handle_post_actions(); // 처리 후 옵션 재로드 $opts = jjsp_get_options(); $palette = (isset($opts['palette']) && is_array($opts['palette'])) ? $opts['palette'] : array_fill(0, 10, ''); $presets = (isset($opts['presets']) && is_array($opts['presets'])) ? $opts['presets'] : []; $auto_enabled= !empty($opts['auto_enabled']); $auto_multi = !empty($opts['auto_multi']); $auto_rules = isset($opts['auto_rules']) ? (string)$opts['auto_rules'] : ''; } } $labels = [ 'C1 Primary','C2 Secondary','C3 Accent/Warn', 'C4 Text','C5 Neutral','C6 Background', 'C7 Text Strong','C8 Muted/Border', 'C9 Info BG','C10 Warn BG' ]; echo '