Files
kate522 264f2c51b2 fix(admin): replicate reference front-submit settings page 1:1
- Rewrite post_list/submit schema (PHP + JS) with the reference theme's
  field set, order, defaults and dependencies; topics fields excluded
- Map PostDisplay::get_submit_settings() and the FrontSubmit runtime to
  the new keys without legacy fallback
- Guest submission follows the capability matrix; category required on
  submit; pay limits read from the cash/points fieldset
- Drop dead front_submit_* settings, template branches and JS config
- Add submit settings reference contract test
2026-09-24 12:29:19 +08:00

38 lines
1.9 KiB
PHP

<?php
/** @var array $ctx */
defined('ABSPATH') || exit;
$is_can_new = !empty($ctx['is_can_new']);
$status = (string) $ctx['post_status'];
$can_draft = !empty($ctx['user_id'])
&& empty($ctx['is_guest'])
&& !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>