Add/change multipart_params parameter when uploading post image

To send a customer data to the server, do the following customFileFrame.uploader.options.uploader.params.yourCustomProperty = ‘yourCustomValue’; Where: yourCustomProperty – parameter name yourCustomValue – parameter value processing data from the server add_action(‘add_attachment’, array($this, ‘addAttachmentParama’)); public function addAttachmentParama($post_id){ if (isset($_REQUEST[‘yourCustomProperty’]) && isset($_REQUEST[‘action’]) && ‘upload-attachment’ == $_REQUEST[‘action’]) { update_post_meta($post_id, ‘yourCustomProperty’, $_REQUEST[‘yourCustomProperty’]); } } Mini Plugin for example <?php /* Plugin … Read more

3.5 media manager add CSS / JS to new ‘tab’ iframe content

You need to en-queue your styles and scripts in your media upload hook and then clal wp_iframe function. Just do it like this and it will work: <?php add_filter( ‘media_upload_tabs’, ‘olab_add_media_tab’ ); function olab_add_media_tab( $tabs ) { $tabs[‘bildarkiv’] = __( ‘Bildarkiv’, ‘bildarkiv’ ); return $tabs; } add_action( ‘media_upload_bildarkiv’, ‘olab_tab_iframe’ ); function olab_tab_iframe() { wp_register_style( ‘bak-css’, … Read more

resize images not crop

Custom Image Sizes Resizing without cropping is already part of the core functionality, via add_image_size(). Note the last parameter: <?php add_image_size( $name, $width, $height, $crop ); ?> The Codex entry describes the $crop parameter as follows: $crop (boolean) (optional) Crop the image or not. False – Soft proportional crop mode ; True – Hard crop … Read more

How to Check Disk Space used by Media Library

Using this StackOverflow Answer, I came up with a Dashboard Widget that displays the following: I extended the OP request for the uploads dir size (default or custom location) and added wp-content (default or custom), blogs.dir case in Multisite, and WordPress base dir. <?php /* Plugin Name: Folder Sizes Dashboard Widget Plugin URI: http://wordpress.stackexchange.com/q/67876/12615 Description: … Read more

Add new media uploader at frontend for wp 3.5+

Add this code to your theme’s functions.php file: function add_media_upload_scripts() { if ( is_admin() ) { return; } wp_enqueue_media(); } add_action(‘wp_enqueue_scripts’, ‘add_media_upload_scripts’); This will cause the the media upload files to load on your front end pages. If you would like to load them only on one specific page where they will be needed, you … Read more

Allowing all/different file type uploads

I had the same issue, it looks like WordPress isn’t able to determine the correct MIME type for RFA files, so it defaults to: ‘application/CDFV2-unknown’ Changing the MIME type to this fixed it for me. So it would be: add_filter( ‘upload_mimes’, function ( $mime_types ) { $mime_types[‘rfa’] = ‘application/CDFV2-unknown’; return $mime_types; } );

HTTP Error when uploading images

There a couple of different solutions depending on the cause of the problem. In your case it seems that is not a upload problem. I would rather try adding the following plugin <?php /* Plugin Name: Default to GD Plugin URI: http://wordpress.org/extend/plugins/default-to-gd Description: Sets GD as default WP_Image_Editor class. Author: Mike Schroder Version: 1.0 Author … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)