进行了一些小修复
This commit is contained in:
@@ -181,16 +181,6 @@ trait FrontSubmitSave {
|
||||
|
||||
$this->save_featured_meta((int) $in_id, $data, $user_id);
|
||||
|
||||
// Legacy thumbnail URL fallback.
|
||||
$thumbnail_url = esc_url_raw((string) ($data['thumbnail'] ?? ''));
|
||||
if ($thumbnail_url !== '' && empty($data['featured_data']) && $this->user_can_cap('upload_submit_image', $user_id)) {
|
||||
$attachment_id = attachment_url_to_postid($thumbnail_url);
|
||||
$attachment = $attachment_id > 0 ? get_post($attachment_id) : null;
|
||||
if ($attachment instanceof \WP_Post && (int) $attachment->post_author === $user_id && wp_attachment_is_image($attachment_id)) {
|
||||
set_post_thumbnail((int) $in_id, $attachment_id);
|
||||
}
|
||||
}
|
||||
|
||||
$post = get_post((int) $in_id);
|
||||
if ($post instanceof \WP_Post) {
|
||||
do_action($is_edit ? 'aksrt_new_edit_posts' : 'aksrt_new_add_posts', $post);
|
||||
|
||||
Reference in New Issue
Block a user