feat(submit): add user media library

This commit is contained in:
2026-09-04 22:53:33 +08:00
parent 44e165d34e
commit f3fcfe45da
23 changed files with 1321 additions and 945 deletions
+6 -4
View File
@@ -60,10 +60,12 @@ $featured_args = ['type' => '', 'data' => new stdClass(), 'options' => [
if ($edit_post) {
if (!empty($post_meta['featured_video'])) {
$featured_args['type'] = 'video';
$featured_args['data'] = [
'url' => (string) $post_meta['featured_video'],
'pic' => (string) ($post_meta['thumbnail_url'] ?? ''),
];
$featured_args['data'] = [
'url' => (string) $post_meta['featured_video'],
'pic' => (string) ($post_meta['thumbnail_url'] ?? ''),
'id' => absint($post_meta['featured_video_attachment_id'] ?? 0),
];
} elseif (!empty($post_meta['featured_slide'])) {
$slides = array_filter(array_map('trim', explode(',', (string) $post_meta['featured_slide'])));
$slide_data = [];
+2 -1
View File
@@ -70,7 +70,8 @@ if (!function_exists('aksrt_submit_pay_line')) {
<button type="button" class="flex1 name-link pay-dawnload-add-edit" data-pay-download-edit><?php echo esc_html((string) ($row['url'] ?? '')); ?></button>
<button type="button" class="pay-dawnload-add-delete em12 ml10 hollow but cir c-red" data-pay-download-remove aria-label="<?php esc_attr_e('删除资源', 'aksrt'); ?>"><i class="fa far fa-trash-alt" aria-hidden="true"></i></button>
<div class="hidden-input">
<?php foreach (['url', 'extract_code', 'copy_key', 'copy_val', 'label', 'class'] as $field) : ?>
<?php foreach (['url', 'attachment_id', 'extract_code', 'copy_key', 'copy_val', 'label', 'class'] as $field) : ?>
<input type="hidden" name="aksrt_pay[downloads][<?php echo (int) $index; ?>][<?php echo esc_attr($field); ?>]" data-pay-download-field="<?php echo esc_attr($field); ?>" value="<?php echo esc_attr((string) ($row[$field] ?? '')); ?>">
<?php endforeach; ?>
</div>