| | |
| | | Route::for('uploads') |
| | | ->post([$this, 'handleUpload']) |
| | | ->auth(PermissionHandler::combine(['nonce'])) |
| | | ->rateLimit(30); |
| | | ->rateLimit(30) |
| | | ->register(); |
| | | |
| | | Route::for('uploads/groups') |
| | | ->post([$this, 'handleGroupingRequest']) |
| | | ->auth(PermissionHandler::combine(['nonce'])) |
| | |
| | | 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); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |