v1.0.0.8
Publisium
- <?php
-
- declare(strict_types=1);
-
- if (!AuthorProfile::isEnabled() || !AuthorProfile::canHaveProfile()) {
- return ['Author pages aren’t available for your role.', 'error', false];
- }
-
- $intent = ($_POST['intent'] ?? '') === 'submit' ? 'submit' : 'draft';
- $accountId = (int) $currentUser['id'];
-
- [$message, $type] = AuthorProfile::save($accountId, (string) $currentUser['display_name'], $_POST, $intent, Auth::canPublishDirectly());
-
- if ($type === 'success') {
- ActivityLog::record($intent === 'submit' ? 'profile.submit' : 'profile.save', 'profile', $accountId);
- }
-
- return [$message, $type, $type === 'success'];
-