public static function save_post($post_id) { if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return; } if (empty($_POST['post_type']) || $_POST['post_type'] != 'wpak_apps') { return; } if (!current_user_can('edit_post', $post_id) && !current_user_can('wpak_edit_apps', $post_id)) { return; } if (!check_admin_referer('wpak-theme-data-' . $post_id, 'wpak-nonce-theme-data')) { return; } if (isset($_POST['wpak_app_title'])) { update_post_meta($post_id, '_wpak_app_title', sanitize_text_field($_POST['wpak_app_title'])); } if (isset($_POST['wpak_app_theme_choice'])) { WpakThemesStorage::set_current_theme($post_id, $_POST['wpak_app_theme_choice']); } }