Clanbite

clanbite_handle_isolated_image_upload( string $files_key, int $post_parent, string $subdir, string $filename_base, string $nonce_action, string $nonce_request_key ): int|\WP_Error

Handle a single image upload into uploads/clanbite/{subdir}/ with a stable filename.

Marks the attachment so it stays out of the Media Library UI. Direct REST fetch by ID (e.g. block editor preview) still works.

Parameters

$files_key (string) Required

Key in $_FILES (e.g. team_avatar).

$post_parent (int) Required

Attachment parent post ID (0 for not linked).

$subdir (string) Required

Path under uploads, e.g. clanbite/teams/12 (no leading/trailing slashes).

$filename_base (string) Required

Filename without extension, e.g. avatar or cover.

$nonce_action (string) Required

Nonce action string (same as wp_create_nonce()).

$nonce_request_key (string) Required

Key in $_POST holding the nonce value.

Returns

int|\WP_Error Attachment ID or error.

Defined in inc/clanbite-private-media.php