| | |
| | | <?php |
| | | namespace JVBase\rest\routes; |
| | | |
| | | use JVBase\base\Site; |
| | | use JVBase\Instance; |
| | | use JVBase\managers\Approvals; |
| | | use JVBase\managers\Cache; |
| | | use JVBase\managers\CustomTable; |
| | | use JVBase\managers\NotificationManager; |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\managers\queue\Queue; |
| | | use JVBase\rest\Rest; |
| | | use JVBase\rest\Route; |
| | | use WP_REST_Request; |
| | |
| | | 'action_user_id' => $group->action_user_id, |
| | | 'type' => $group->type |
| | | ]) |
| | | ->orderBy('created_at', 'DESC') |
| | | ->orderBy('created_at') |
| | | ->first(); |
| | | |
| | | if ($notification) { |
| | |
| | | */ |
| | | protected function getItemLink(int $ID, string $content): string |
| | | { |
| | | switch ($content) { |
| | | case BASE.'artist': |
| | | case BASE.'artwork': |
| | | case BASE.'event': |
| | | case BASE.'news': |
| | | case BASE.'offer': |
| | | case BASE.'partner': |
| | | case BASE.'piercing': |
| | | case BASE.'tattoo': |
| | | return get_permalink($ID); |
| | | default: |
| | | return get_term_link($ID, BASE.$content); |
| | | } |
| | | return match ($content) { |
| | | BASE . 'artist', BASE . 'artwork', BASE . 'event', BASE . 'news', BASE . 'offer', BASE . 'partner', BASE . 'piercing', BASE . 'tattoo' => get_permalink($ID), |
| | | default => get_term_link($ID, BASE . $content), |
| | | }; |
| | | } |
| | | |
| | | /** |
| | |
| | | return $irregular[$word]; |
| | | } |
| | | |
| | | if (substr($word, -1) === 'y') { |
| | | if (str_ends_with($word, 'y')) { |
| | | return substr($word, 0, -1) . 'ies'; |
| | | } |
| | | |