feat(links): move friend links to native WordPress links with review flow
- enable the native Links manager and drop the custom friend-link option/REST path - add per-page link settings for the friends template - render link categories from get_bookmarks() with search and page-content options - add a validated public link submission endpoint with logo upload, captcha, rate limiting and duplicate checks - create pending links for review and notify administrators by email and in-app message - add native Links admin pending count, columns and edit notes - cover the new submission and cleanup contracts Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ef7b5939ba
commit
4c562428b4
24 files changed
+792
-273
No files matched your search
+30
-11
@@ -536,20 +536,39 @@ trait ScriptsPart1b {
|
||||
);
|
||||
}
|
||||
|
||||
// 友情链接页:路由专属 CSS
|
||||
// 友情链接页:原生链接列表 + 申请表单
|
||||
if (is_page_template('templates/pages/page-friends.php')) {
|
||||
wp_enqueue_style(
|
||||
'jio-route-friends',
|
||||
$base_uri . '/assets/css/routes/friends.css',
|
||||
['jio-public'],
|
||||
file_exists(get_template_directory() . '/assets/css/routes/friends.css')
|
||||
? (string) filemtime(get_template_directory() . '/assets/css/routes/friends.css')
|
||||
: $version
|
||||
);
|
||||
$links_css = get_template_directory() . '/assets/css/routes/links.css';
|
||||
if (file_exists($links_css)) {
|
||||
wp_enqueue_style(
|
||||
'jio-route-links',
|
||||
$base_uri . '/assets/css/routes/links.css',
|
||||
['jio-public'],
|
||||
(string) filemtime($links_css)
|
||||
);
|
||||
}
|
||||
$links_js = get_template_directory() . '/assets/js/links-submit.js';
|
||||
if (file_exists($links_js)) {
|
||||
wp_enqueue_script(
|
||||
'jio-links-submit',
|
||||
$base_uri . '/assets/js/links-submit.js',
|
||||
['loader_js'],
|
||||
(string) filemtime($links_js),
|
||||
true
|
||||
);
|
||||
wp_localize_script('jio-links-submit', 'jioLinksSubmit', [
|
||||
'ajaxUrl' => admin_url('admin-ajax.php'),
|
||||
'i18n' => [
|
||||
'submitting' => __('正在提交…', 'jio'),
|
||||
'success' => __('提交成功', 'jio'),
|
||||
'error' => __('提交失败,请重试', 'jio'),
|
||||
'captcha' => __('请完成人机验证', 'jio'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 网址导航页(legacy links.php)
|
||||
// 文章导航页(legacy postsnavs.php)
|
||||
// 文章导航页(postsnavs.php)
|
||||
if (is_page_template('templates/pages/page-posts-navs.php')) {
|
||||
$page_navs_js = get_template_directory() . '/assets/js/page-navs.js';
|
||||
if (file_exists($page_navs_js)) {
|
||||
|
||||
Reference in new issue
Block a user