Have you tried to use a filter for 'media_view_strings'?
I have made a similar uploader like you need with a filter like this:
function my_view_strings( $strings) {
// disable some views
$disabled = array( 'selectFiles', 'createNewGallery', insertFromUrlTitle', 'createGalleryTitle' );
foreach( $disabled as $string )
$strings[$string] = '';
$strings['allMediaItems'] = __( 'Select a view', 'eazyest-gallery' );
$strings['insertIntoPost'] = __( 'Done uploading', 'eazyest-gallery' );
return $strings;
}
add_filter( 'media_view_strings', 'my_view_strings' );
and add this in a style element to hide the buttons:
.button.button-large.media-button-gallery {
height: 0;
padding: 0;
}
.media-menu-item:empty {
display: none;
}
hope this helps
Hi,
Yes Thank you! I did do that at first, but I could not get the simplicity that I wanted because I could not get my CSS to over-ride the media template even with !important, then I found a filter that made it possible to add styles (thanks to: brasofilo: http://wordpress.stackexchange.com/questions/75746/how-to-add-custom-css-to-the-media-thickbox). From that point on it was FUN. I ended up unsetting the media library tab, styling away everything except the uploader. I also styled away the edit button in the editor window and put it all in a plugin for a simple uploader. Then I made another plugin for removing all links around images. Then I styled all the different alignment possibilities to be what I want them to be in my normal stylesheet.
Here is what I used for the uploader plugin (I am sure there are extra styles, but it was late and it works) It can also just go in the functions.php for anyone else that does not want to have a plugin:
//Get rid of media library tab
add_filter( 'media_view_strings', 'custom_media_uploader' );
function custom_media_uploader( $strings ) {
unset( $strings['mediaLibraryTitle'] ); //Media Library
return $strings;
}
//Add new styles to get rid of what I don't want and to make it pretty
add_action( 'print_media_templates', 'my_simple_uploader' );
function my_simple_uploader()
{
?>
<!--Style away the side menu, the media library browser, re-design what is left-->
<style>
.media-menu,.attachments-browser,.media-frame-menu,#wp_editimgbtn,.media-router .active:after {
display:none;
}
.media-modal{
width:600px;
max-height:400px;
margin:auto;
}
.media-frame-title h1{
font-family:"gill sans";
}
.media-frame-title,.media-frame-router,.media-frame-toolbar{
left:0px;
text-align:center;
}
.media-frame-content,.uploader-inline-content{
margin-top:40px;
position:static;
text-align:center;
}
.media-toolbar,.media-toolbar-primary{
position:static;
width:128px;
padding:0px;
margin:auto;
float:none;
text-align:center;
}
media-button-insert{
display:block;
}
.media-router{
float:none;
width:100px;
margin:auto;
}
.media-router a{
border-right:0px;
}
</style>
<?php
}
Here is the filter for removing link tags around all images before they go to the browser. Even old ones which is great because I was re-designing a blog with old posts. I tried a number of filters with regex but this one worked for me, and I am happy not to have to write my own preg_replace (thanks to: krembo99: http://stackoverflow.com/questions/11282580/how-to-remove-hyperlink-of-images-in-wordpress-post ). (Note; this works in the functions.php but I made a separate plugin for it.) Here is the code:
add_filter( 'the_content', 'remove_image_link' );
function remove_image_link( $content ) {
$content =
preg_replace(array('{<a[^>]*><img}','{/></a>}'), array('<img','/>'), $content);
return $content;
}
This works great,
Now I only need a way to distinguish between Add Media and Set featured image.
I was lucky, I did not need featured image capability. I am sure that would be very useful (and challenging!). I would be interested to see what you come up with.
I am surprised —with all the work that went into the Media Manager— that the developers have not come up with a back-end way to turn on and off every possible feature. Like the Adminize plugin does for the admin screens. I think it should be a core feature.