Jake Vanderwerf
2026-02-11 1ee52f219a516d831b4be6bd05bce224afa28189
=minor fixes to uploading
1 files modified
6 ■■■■■ changed files
inc/rest/routes/UploadRoutes.php 6 ●●●●● patch | view | raw | blame | history
inc/rest/routes/UploadRoutes.php
@@ -134,7 +134,6 @@
                case 'item_id':
                    if (is_numeric($value)) {
                        $args['item_id'] = absint($value);
                        // item_id IS the post/term being edited — use as post_id if not already set
                        if (!array_key_exists('post_id', $args)) {
                            $args['post_id'] = absint($value);
                        }
@@ -159,7 +158,10 @@
                case 'user':
                    if ($this->userCheck($value)) {
                        $args['user'] = (int) $value;
                        if (!array_key_exists('post_id', $args) && !array_key_exists('term_id', $args) && !array_key_exists('item_id', $args)) {
                        if (!array_key_exists('post_id', $args) &&
                            !array_key_exists('post_id', $data) &&
                            !array_key_exists('term_id', $data) &&
                            !array_key_exists('item_id', $data)) {
                            $args['post_id'] = (int)get_user_meta((int) $value, BASE.'link', true);
                        }
                    }