feat(share): align social sharing runtime
This commit is contained in:
1 parent
26ac8167f3
commit
cf6c11852e
33 files changed
+802
-1919
No files matched your search
@@ -48,10 +48,6 @@ class WeChatShare {
|
||||
'1.6.0',
|
||||
true
|
||||
);
|
||||
// Ensure our bridge runs after jweixin.
|
||||
if (wp_script_is('aksrt-weixin-share', 'registered') || wp_script_is('aksrt-weixin-share', 'enqueued')) {
|
||||
wp_script_add_data('aksrt-weixin-share', 'group', 1);
|
||||
}
|
||||
}
|
||||
|
||||
public function print_share_date(): void {
|
||||
@@ -154,12 +150,9 @@ window.WeChatShareDate = <?php echo wp_json_encode($payload, JSON_UNESCAPED_UNIC
|
||||
|
||||
private function resolve_image(): string {
|
||||
$only_logo = !empty($this->config['only_logo']);
|
||||
$default = '';
|
||||
if (!empty($this->config['share_img'])) {
|
||||
$default = (string) $this->config['share_img'];
|
||||
} elseif (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$default = (string) (\AKSRT\Settings\Settings::get_value('favicon', '') ?: \AKSRT\Settings\Settings::get_value('iconpng', ''));
|
||||
}
|
||||
$default = class_exists('\\AKSRT\\Settings\\Settings')
|
||||
? (string) \AKSRT\Settings\Settings::favicon_url()
|
||||
: (string) get_site_icon_url(512);
|
||||
if ($only_logo) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user