feat(forum): add complete forum workflows
This commit is contained in:
1 parent
a254cbd3e9
commit
ee65fc7fd2
39 files changed
+3425
-4
No files matched your search
@@ -46,6 +46,7 @@ class SchemaProvider {
|
||||
'payment',
|
||||
'extensions',
|
||||
'tools',
|
||||
'forum',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -93,6 +94,7 @@ class SchemaProvider {
|
||||
'payment' => 'jio_settings',
|
||||
'extensions' => 'jio_settings',
|
||||
'tools' => 'jio_settings',
|
||||
'forum' => 'jio_settings',
|
||||
];
|
||||
|
||||
return $primary[$this->normalize_domain($domain)] ?? 'jio_settings';
|
||||
@@ -278,6 +280,21 @@ class SchemaProvider {
|
||||
}
|
||||
$errors = array_merge($errors, $this->validate_oauth_settings($merged, is_array($stored) ? $stored : []));
|
||||
}
|
||||
if ($domain === 'forum' && ($section === 'urls' || $section === '')) {
|
||||
$stored = get_option('jio_settings', []);
|
||||
$merged = array_merge(is_array($stored) ? $stored : [], $data);
|
||||
$slugs = [];
|
||||
foreach (['plate' => 'forum', 'post' => 'forum-post', 'edit' => 'posts-edit'] as $type => $default) {
|
||||
$slug = (string) ($merged['jio_forum_slug_' . $type] ?? $default);
|
||||
if ($slug === '' || $slug !== sanitize_title($slug) || in_array($slug, ['forums', 'user', 'author', 'wp-admin', 'wp-json'], true)) {
|
||||
$errors[] = __('论坛路径无效或与保留路径冲突', 'jio');
|
||||
}
|
||||
$slugs[] = $slug;
|
||||
}
|
||||
if (count(array_unique($slugs)) !== count($slugs)) {
|
||||
$errors[] = __('论坛路径不能重复', 'jio');
|
||||
}
|
||||
}
|
||||
|
||||
if ($domain === 'payment' && $section === 'withdrawal') {
|
||||
$stored = get_option('jio_settings', []);
|
||||
@@ -377,6 +394,7 @@ class SchemaProvider {
|
||||
'payment' => Schema\SchemaPayment::class,
|
||||
'extensions' => Schema\SchemaExtensions::class,
|
||||
'tools' => Schema\SchemaTools::class,
|
||||
'forum' => Schema\SchemaForum::class,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user