fix: option default value

pull/516/head
Seaton Jiang 2022-05-27 11:49:53 +08:00
parent 22217f4659
commit bc906b6c83
No known key found for this signature in database
GPG Key ID: B79682F6FE8D30E3
3 changed files with 6 additions and 6 deletions

View File

@ -102,8 +102,8 @@ function theme_autoload()
$data = array( $data = array(
'site' => home_url(), 'site' => home_url(),
'directory' => ASSET_PATH, 'directory' => ASSET_PATH,
'alipay' => kratos_option('g_donate_fieldset')['g_donate_alipay'], 'alipay' => kratos_option('g_donate_fieldset')['g_donate_alipay'] ?? '',
'wechat' => kratos_option('g_donate_fieldset')['g_donate_wechat'], 'wechat' => kratos_option('g_donate_fieldset')['g_donate_wechat'] ?? '',
'repeat' => __('您已经赞过了', 'kratos'), 'repeat' => __('您已经赞过了', 'kratos'),
'thanks' => __('感谢您的支持', 'kratos'), 'thanks' => __('感谢您的支持', 'kratos'),
'donate' => __('打赏作者', 'kratos'), 'donate' => __('打赏作者', 'kratos'),

View File

@ -4,7 +4,7 @@
* 文章工具栏 * 文章工具栏
* @author Seaton Jiang <hi@seatonjiang.com> * @author Seaton Jiang <hi@seatonjiang.com>
* @license GPL-3.0 License * @license GPL-3.0 License
* @version 2022.01.26 * @version 2022.05.27
*/ */
?> ?>
<div class="toolbar clearfix"> <div class="toolbar clearfix">
@ -14,7 +14,7 @@
<p class="motto mb-0"><?php echo $description = !empty(get_the_author_meta('description')) ? get_the_author_meta('description') : __('这个人很懒,什么都没留下', 'kratos'); ?></p> <p class="motto mb-0"><?php echo $description = !empty(get_the_author_meta('description')) ? get_the_author_meta('description') : __('这个人很懒,什么都没留下', 'kratos'); ?></p>
</div> </div>
<div class="share float-md-right text-center"> <div class="share float-md-right text-center">
<?php if (kratos_option('g_donate_fieldset')['g_donate']) { ?> <?php if (kratos_option('g_donate_fieldset')['g_donate'] ?? false) { ?>
<a href="javascript:;" id="donate" class="btn btn-donate mr-3" role="button"><i class="kicon i-donate"></i> <?php _e('打赏', 'kratos'); ?></a> <a href="javascript:;" id="donate" class="btn btn-donate mr-3" role="button"><i class="kicon i-donate"></i> <?php _e('打赏', 'kratos'); ?></a>
<?php } ?> <?php } ?>
<a href="javascript:;" id="thumbs" data-action="love" data-id="<?php the_ID(); ?>" role="button" class="btn btn-thumbs <?php if (isset($_COOKIE['love_' . $post->ID])) echo 'done'; ?>"><i class="kicon i-like"></i><span class="ml-1"><?php _e('点赞', 'kratos'); ?></span></a> <a href="javascript:;" id="thumbs" data-action="love" data-id="<?php the_ID(); ?>" role="button" class="btn btn-thumbs <?php if (isset($_COOKIE['love_' . $post->ID])) echo 'done'; ?>"><i class="kicon i-like"></i><span class="ml-1"><?php _e('点赞', 'kratos'); ?></span></a>

View File

@ -121,7 +121,7 @@ $col_array = array(
} }
?> ?>
</div> </div>
<?php if (kratos_option('g_cc_fieldset')['g_cc_switch']) { <?php if (kratos_option('g_cc_fieldset')['g_cc_switch'] ?? false) {
$cc_array = array( $cc_array = array(
'one' => __('知识共享署名 4.0 国际许可协议', 'kratos'), 'one' => __('知识共享署名 4.0 国际许可协议', 'kratos'),
'two' => __('知识共享署名-非商业性使用 4.0 国际许可协议', 'kratos'), 'two' => __('知识共享署名-非商业性使用 4.0 国际许可协议', 'kratos'),