Unable to upload new file as a product

WordPress does not allow uploads of .xml files but you can add it by adding a mime type for it. This worked for me: function addUploadXML($mimes) { $mimes = array_merge($mimes, array(‘xml’ => ‘text/xml’));. return $mimes; } add_filter(‘upload_mimes’, ‘addUploadXML’); Also, when I researched the mime type, I came up with a number of different suggestions for … Read more

How to remove a tab in Media Upload page in wordpress

I’m not sure it has to do with enqueueing, if all you want to do is hide the Media Library tab in the media upload window. I found the following solution (haven’t tried it myself): function remove_media_library_tab($tabs) { unset($tabs[‘library’]); return $tabs; } add_filter(‘media_upload_tabs’, ‘remove_media_library_tab’); The link contains some more details as to why this is … Read more

Limit image upload to 10

here you go: get_posts(array(‘post_type’=>’attachment’, ‘numberposts’ => 10, ‘post_parent’ => $post_id)); this will return you upto 10 posts.

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