Allow CSV files to be uploaded

There’s a bug in WordPress 4.7-4.7.3 related to validating MIME types, so the code provided by Dave Romsey won’t work. There’s a plugin in the repo that will bypass MIME checks, but it disables the checks for all users and all extensions. I think a better way would be to add a new capability for … Read more

How to restrict images in v3.5 Media Library modal to only those from a specific post id?

I am not sure is this what you are looking for. This code will “lock” uploads to show only “Uploaded to this post” in media panel add_action( ‘admin_footer-post-new.php’, ‘firmasite_mediapanel_lock_uploaded’ ); add_action( ‘admin_footer-post.php’, ‘firmasite_mediapanel_lock_uploaded’ ); function firmasite_mediapanel_lock_uploaded() { ?> <script type=”text/javascript”> jQuery(document).on(“DOMNodeInserted”, function(){ // Lock uploads to “Uploaded to this post” jQuery(‘select.attachment-filters [value=”uploaded”]’).attr( ‘selected’, true ).parent().trigger(‘change’); … Read more

Media Upload Folder – how to manage

A simple answer is that you can remove 2 unused sizes by enter 0 for their width or height. For example, you need only the small thumbnail 150×150 and full-sized image, so enter 0 for width and height of Medium and Large sizez.

Is it possible to allow zip files to be uploaded in WordPress?

Here is a action that works on my site: add_filter(‘upload_mimes’, ‘custom_upload_mimes’); function custom_upload_mimes ( $existing_mimes=array() ) { // add your extension to the mimes array as below $existing_mimes[‘zip’] = ‘application/zip’; $existing_mimes[‘gz’] = ‘application/x-gzip’; return $existing_mimes; }

How to insert images into posts without using Add Media dialog

The WordPress default media management system is pretty good and far better than what you want. However, you can use the Advanced Custom Fields to add image upload boxes in your post editor page. Once the image is uploaded, you can display it in the editor using a shortcode [acf field=”{$field_name}”]. Check out ACF Documentation … Read more

Insert images to post not working

Have you enabled debugging in wp-config.php change define(‘WP_DEBUG’, false); to define(‘WP_DEBUG’, true); This will cause WordPress and php to generate a lot more error messages. With very little detail to go on, my first guess would be file permissions on the upload directory on your server.

How to get attachment id as soon as it is uploaded through media uploader in jquery?

You are close, you just need to hook into the add event instead of the reset event. (In case you did not know, these are standard events provided by Backbone collections. So familiarizing yourself with that will be helpful when developing things around stuff where WordPress employs Backbone.js.) So basically you’d modify your code like … Read more

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