43 lines
977 B
PHP
43 lines
977 B
PHP
<?php
|
|
/**
|
|
* Lightweight message-center URL alias harness.
|
|
*/
|
|
|
|
namespace {
|
|
define('ABSPATH', __DIR__);
|
|
|
|
class AKSRT_User_Notifications {}
|
|
|
|
function sanitize_key($value): string {
|
|
return preg_replace('/[^a-z0-9_\-]/', '', strtolower((string) $value)) ?? '';
|
|
}
|
|
|
|
function home_url(string $path = ''): string {
|
|
return 'https://example.test' . $path;
|
|
}
|
|
}
|
|
|
|
namespace AKSRT\Settings {
|
|
final class Settings {
|
|
public static function notification_settings(): array {
|
|
return ['slug' => 'inbox-center'];
|
|
}
|
|
|
|
public static function message_enabled(): bool {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace {
|
|
require_once dirname(__DIR__, 2) . '/inc/modules/user-parts/urls.php';
|
|
|
|
echo json_encode([
|
|
'slug' => aksrt_get_messages_rewrite_slug(),
|
|
'unread' => aksrt_get_messages_page_url(),
|
|
'posts' => aksrt_get_messages_page_url('posts'),
|
|
'like' => aksrt_get_messages_page_url('like'),
|
|
'system' => aksrt_get_messages_page_url('system'),
|
|
], JSON_UNESCAPED_SLASHES);
|
|
}
|