40 lines
2.0 KiB
PHP
40 lines
2.0 KiB
PHP
<?php
|
|
/** @var array $ctx */
|
|
defined('ABSPATH') || exit;
|
|
|
|
$settings = $ctx['settings'];
|
|
$is_can_new = !empty($ctx['is_can_new']);
|
|
$status = (string) $ctx['post_status'];
|
|
$can_draft = !empty($ctx['user_id'])
|
|
&& empty($ctx['is_guest'])
|
|
&& !empty($settings['draft_save'])
|
|
&& !in_array($status, ['publish', 'pending'], true);
|
|
?>
|
|
<div class="zib-widget">
|
|
<div class="text-center">
|
|
<p class="separator muted-3-color theme-box"><?php esc_html_e('Are you ready', 'aksrt'); ?></p>
|
|
<input type="hidden" name="posts_id" value="<?php echo esc_attr((string) (int) $ctx['edit_id']); ?>">
|
|
<input type="hidden" name="status" id="submit-status" value="pending">
|
|
<input type="hidden" name="_nonce" value="<?php echo esc_attr(wp_create_nonce('aksrt_submit')); ?>">
|
|
|
|
<?php if (!$is_can_new) : ?>
|
|
<p class="em09 muted-3-color theme-box"><?php esc_html_e('暂无发布权限', 'aksrt'); ?></p>
|
|
<?php else : ?>
|
|
<?php if (!empty($ctx['is_guest'])) : ?>
|
|
<p class="em09 muted-3-color theme-box"><?php esc_html_e('您当前未登录,不能保存草稿,文章提交后不可再修改!', 'aksrt'); ?></p>
|
|
<?php endif; ?>
|
|
|
|
<?php if (function_exists('aksrt_is_captcha_enabled_for') && function_exists('aksrt_render_captcha') && aksrt_is_captcha_enabled_for('front_submit')) : ?>
|
|
<div class="mb10"><?php aksrt_render_captcha('front_submit'); ?></div>
|
|
<?php endif; ?>
|
|
|
|
<div class="but-average">
|
|
<?php if ($can_draft) : ?>
|
|
<button type="button" class="but jb-green new-posts-submit aksrt-submit-btn padding-lg" data-action="posts_draft"><i class="fa fas fa-fw fa-dot-circle"></i><?php esc_html_e('保存草稿', 'aksrt'); ?></button>
|
|
<?php endif; ?>
|
|
<button type="button" class="but jb-blue new-posts-submit aksrt-submit-btn padding-lg" data-action="posts_save" id="aksrt-submit-btn"><i class="fa fas fa-fw fa-check-square"></i><?php printf(esc_html__('提交%s', 'aksrt'), esc_html((string) $ctx['submit_label'])); ?></button>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|