How to add an upload image button (just like the one in the Custom Header) in the Theme Options I just created?
Referring to this post How to use media upload on theme option page? Check if you find anything helpful. Thanks!
Referring to this post How to use media upload on theme option page? Check if you find anything helpful. Thanks!
create shortened URL function, then add filter on the_content() to replace all img src URL to shortened URL
Check Settings -> Media -> Uploading Files
This can be achieved using the plugin Advanced Custom Fields. Config Result
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
You can do an untrailingslashit() also.
Not sure if I’ve understand this correctly but you should be able to check which tab is currently open by looking at $_GET[‘tab’] upload new tab = type from url = type_url gallery = gallery media library = library So you could wrap your code inside if ( $_GET[‘tab’] != ‘type’ ) // do stuff
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
Something you can try, but I haven’t tested it throughly, and you’ll need to do some QA to make sure it doesn’t ripple out and affect anything else. Explanation: The function that returns paths to the upload directory is called wp_upload_dir(). It’s used in a bunch of places (and by a lot of plugins) to … Read more
here you go: get_posts(array(‘post_type’=>’attachment’, ‘numberposts’ => 10, ‘post_parent’ => $post_id)); this will return you upto 10 posts.