feat(users): govern profiles and access
Normalize fixed profile fields, profile actions, and the five-column capability matrix for comments, uploads, and downloads.
This commit is contained in:
@@ -183,8 +183,12 @@ trait FrontSubmitSave {
|
||||
|
||||
// Legacy thumbnail URL fallback.
|
||||
$thumbnail_url = esc_url_raw((string) ($data['thumbnail'] ?? ''));
|
||||
if ($thumbnail_url !== '' && empty($data['featured_data'])) {
|
||||
$this->set_thumbnail_from_url((int) $in_id, $thumbnail_url);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user