Trying to add filename over image in Media Browser
Trying to add filename over image in Media Browser
Trying to add filename over image in Media Browser
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
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
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 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
File Upload Permissions
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; } );
Untested but I am pretty sure this is the issue: You are trying to attach $uploadedfile to the email. You’ve set $uploadedfile to $_FILES[‘file’]. That is a very temporary file/file location. Once you use wp_handle_upload you want to be using $movefile instead. If you look at the Codex entry for that function you can see … Read more
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
Use filter ‘upload_mimes‘. <?php add_filter(‘upload_mimes’,’add_java_files’); function add_java_files($mimes) { // Add file extension ‘extension’ with mime type ‘mime/type’ $mimes[‘java’] = ‘text/x-java-source’; return $mimes; }