feat(share): align social sharing runtime
This commit is contained in:
@@ -281,9 +281,7 @@ class PostDisplay {
|
||||
'like_enabled' => !isset($settings['post_like_s']) || !empty($settings['post_like_s']),
|
||||
// 参考主题无收藏开关:收藏按钮常显(字段已随 1:1 复刻移除)。
|
||||
'favorite_enabled' => true,
|
||||
// Canonical + legacy share.
|
||||
'share_enabled' => $share_enabled,
|
||||
'share_s' => $share_enabled,
|
||||
// Author card posts(参考主题无独立配置:保持默认)。
|
||||
'author_card_limit' => 6,
|
||||
'author_card_orderby' => 'views',
|
||||
@@ -346,22 +344,6 @@ class PostDisplay {
|
||||
];
|
||||
}
|
||||
|
||||
public static function get_share_settings(): array {
|
||||
$settings = Settings::get_all();
|
||||
return [
|
||||
'enabled' => !isset($settings['share_s']) || !empty($settings['share_s']),
|
||||
'wechat_appid' => sanitize_text_field((string) ($settings['wechat_share_appid'] ?? '')),
|
||||
'wechat_timestamp' => sanitize_text_field((string) ($settings['wechat_share_timestamp'] ?? '')),
|
||||
'wechat_nonce' => sanitize_text_field((string) ($settings['wechat_share_nonce'] ?? '')),
|
||||
'wechat_signature' => sanitize_text_field((string) ($settings['wechat_share_signature'] ?? '')),
|
||||
'poster_enabled' => !empty($settings['post_share_poster_s']),
|
||||
'poster_qr_enabled' => !empty($settings['post_share_poster_qr_s']),
|
||||
'poster_bg' => (string) ($settings['post_share_poster_bg'] ?? ''),
|
||||
'social_items' => is_array($settings['social_share_items'] ?? null) ? $settings['social_share_items'] : [],
|
||||
'copy_link_enabled' => !isset($settings['post_share_copylink_s']) || !empty($settings['post_share_copylink_s']),
|
||||
];
|
||||
}
|
||||
|
||||
public static function get_submit_settings(): array {
|
||||
$settings = Settings::get_all();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user