• Hello,

    I’m trying to run some custom functionality after the upload has finished. It would be cool if a custom action hook fired after all the chunks have uploaded and the attachment ID has been created. Currently, what I’m doing is:

    add_filter( 'wp_prepare_attachment_for_js' function( $response ) {
    	$chunk  = isset( $_REQUEST['chunk'] ) ? intval( $_REQUEST['chunk'] ) : 0;
    	$chunks = isset( $_REQUEST['chunks'] ) ? intval( $_REQUEST['chunks'] ) : 0;
    	if( ! $chunks || $chunk !== $chunks - 1 ) {
    		return $response;
    	}
    	
    	/* Custom functionality. */
    } );

    If there’s a better hook to run once the uploader has finished, please let me know!

  • The topic ‘Action Hook When Chunker Done Chunking’ is closed to new replies.