diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 55c1531512..408854e705 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1122,6 +1122,7 @@ function get_media_item( $attachment_id, $args = null ) { $default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true ); $args = wp_parse_args( $args, $default_args ); + $args = apply_filters( 'get_media_item_args', $args ); extract( $args, EXTR_SKIP ); $toggle_on = __( 'Show' ); @@ -1397,7 +1398,26 @@ if ( is_multisite() && !is_upload_space_available() ) { do_action('pre-upload-ui'); -if ( $flash ) : ?> +if ( $flash ) : + +// Set the post params, which SWFUpload will post back with the file, and pass +// them through a filter. +$post_params = array( + "post_id" => $post_id, + "auth_cookie" => (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]), + "logged_in_cookie" => $_COOKIE[LOGGED_IN_COOKIE], + "_wpnonce" => wp_create_nonce('media-form'), + "type" => $type, + "tab" => $tab, + "short" => "1", +); +$post_params = apply_filters( 'swfupload_post_params', $post_params ); +$p = array(); +foreach ( $post_params as $param => & $val ) + $p[] = "\t\t'$param' : '$val'"; +$post_params_str = implode( ", \n", $p ); + +?>