Skip to content

atmosphere_pre_upload_blob

github-actions[bot] edited this page Jul 14, 2026 · 3 revisions

Short-circuits the uploadBlob call before it reaches the PDS.

Return a non-null array (the PDS success shape, e.g. [ 'blob' => [...] ]) or a WP_Error to bypass the real HTTP round-trip. Mirrors atmosphere_pre_apply_writes: the real upload runs inside wp_safe_remote_request after a DPoP proof has been built, so test environments and the FOSSE harness use this filter to observe or mock the upload without a live PDS.

Auto-generated Example

/**
 * Short-circuits the uploadBlob call before it reaches the PDS.
 * 
 * Return a non-null array (the PDS success shape, e.g.
 * `[ 'blob' => [...] ]`) or a `WP_Error` to bypass the real HTTP
 * round-trip. Mirrors `atmosphere_pre_apply_writes`: the real
 * upload runs inside `wp_safe_remote_request` after a DPoP proof
 * has been built, so test environments and the FOSSE harness use
 * this filter to observe or mock the upload without a live PDS.
 *
 * @param null|array|\WP_Error $short_circuit 
 * @param string               $file_path 
 * @param string               $mime_type 
 * @return null|array|\WP_Error The filtered value.
 */
function my_atmosphere_pre_upload_blob_callback( null|array|\WP_Error $short_circuit, string $file_path, string $mime_type ) {
    // Your code here.
    return $short_circuit;
}
add_filter( 'atmosphere_pre_upload_blob', 'my_atmosphere_pre_upload_blob_callback', 10, 3 );

Parameters

  • null|array|\WP_Error $short_circuit Short-circuit value. Return null to skip.
  • string $file_path Local path of the file about to be uploaded.
  • string $mime_type MIME type of the file.

Files

\apply_filters( 'atmosphere_pre_upload_blob', null, $file_path, $mime_type )

← All Hooks

Clone this wiki locally