- assets/vendor 全量迁移: fontawesome5→assets/fontawesome5, css→assets/css, js→assets/js/runtime(避开 14 个同名自有文件), img 合并去重→assets/img, fonts→assets/fonts; 删除 assets/vendor - libs 五个与 widgets/third-party 字节相同的库不重复入库, loader paths 改指向 - 运行时切换: _win.uri=assets 根, loader baseUrl=/js/runtime, enlighter 注入 路径同步; PHP 7 个引用文件切换并改名 $zibll_*→$runtime_* - 去品牌: Qinver 头注释/品牌 console.log/演示链接清除, 默认文案中性化 - 功能标识符改名: zib__→aksrt__, zib_ajax→aksrt_ajax, window.zib→ window.aksrtLegacy, zibllblock/*→aksrtblock/*, .zib-widget→.aksrt-panel, .zib-slider→.aksrt-slider, zib_menu_options meta 键等 - 自有 CSS 改名: legacy-utilities/compat-vars/footer shell - admin SPA 重建; 契约测试同步(路径/断言/文件更名) - 例外保留: tests/visual 对照环境与 fixtures 前缀(外部 Zibll 产品引用) 验证: php -l 133 个改动文件通过; runtime 86 个 JS node --check 通过; 契约测试 68/70(2 个失败经 stash 对照确认为存量问题)
86 lines
3.4 KiB
PHP
86 lines
3.4 KiB
PHP
<?php
|
|
/**
|
|
* Submit actions + drafts list.
|
|
*
|
|
* @var array $ctx
|
|
* @package AKSRT
|
|
*/
|
|
defined('ABSPATH') || exit;
|
|
|
|
$settings = $ctx['settings'];
|
|
$is_can_new = !empty($ctx['is_can_new']);
|
|
$edit_post = $ctx['edit_post'];
|
|
$status = (string) $ctx['post_status'];
|
|
$can_draft = !empty($ctx['user_id']) && empty($ctx['is_guest']) && !empty($settings['draft_save']);
|
|
if ($edit_post && in_array($status, ['publish', 'pending'], true)) {
|
|
// Still allow draft button? legacy hides draft for publish/pending.
|
|
$can_draft = false;
|
|
}
|
|
?>
|
|
<div class="aksrt-submit-panel">
|
|
<div class="aksrt-submit-panel__body aksrt-submit-actions">
|
|
<p class="aksrt-submit-ready"><?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="aksrt-submit-hint"><?php esc_html_e('暂无发布权限', 'aksrt'); ?></p>
|
|
<?php else : ?>
|
|
<?php if (!empty($ctx['is_guest'])) : ?>
|
|
<p class="aksrt-submit-hint"><?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="aksrt-submit-captcha">
|
|
<?php aksrt_render_captcha('front_submit'); ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="aksrt-submit-actions__btns">
|
|
<?php if ($can_draft) : ?>
|
|
<button type="button" class="but jb-green aksrt-submit-btn" data-action="posts_draft">
|
|
<i class="fa fas fa-dot-circle"></i> <?php esc_html_e('保存草稿', 'aksrt'); ?>
|
|
</button>
|
|
<?php endif; ?>
|
|
<button type="button" class="but jb-blue aksrt-submit-btn" data-action="posts_save" id="aksrt-submit-btn">
|
|
<i class="fa fas fa-check-square"></i>
|
|
<?php
|
|
printf(
|
|
/* translators: %s: 发布|审核|保存 */
|
|
esc_html__('提交%s', 'aksrt'),
|
|
esc_html((string) $ctx['submit_label'])
|
|
);
|
|
?>
|
|
</button>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<?php if (!empty($ctx['user_drafts'])) : ?>
|
|
<div class="aksrt-submit-panel aksrt-submit-drafts">
|
|
<div class="aksrt-submit-panel__title">
|
|
<i class="fa fas fa-file-alt"></i> <?php esc_html_e('我的草稿', 'aksrt'); ?>
|
|
</div>
|
|
<div class="aksrt-submit-panel__body">
|
|
<?php foreach ($ctx['user_drafts'] as $draft) :
|
|
$edit_url = function_exists('aksrt_get_new_post_url')
|
|
? aksrt_get_new_post_url((int) $draft->ID)
|
|
: add_query_arg('edit', $draft->ID, get_permalink());
|
|
?>
|
|
<div class="aksrt-submit-drafts__item" data-draft-id="<?php echo esc_attr((string) $draft->ID); ?>">
|
|
<a href="<?php echo esc_url($edit_url); ?>" class="aksrt-submit-drafts__link">
|
|
<span class="aksrt-submit-drafts__name"><?php echo esc_html($draft->post_title ?: __('无标题', 'aksrt')); ?></span>
|
|
<time><?php echo esc_html(get_the_modified_date('Y-m-d H:i', $draft)); ?></time>
|
|
</a>
|
|
<button type="button" class="aksrt-submit-drafts__delete" data-draft-id="<?php echo esc_attr((string) $draft->ID); ?>" title="<?php esc_attr_e('删除草稿', 'aksrt'); ?>">
|
|
<i class="fa fas fa-trash-alt"></i>
|
|
</button>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|