Skip to content

Instantly share code, notes, and snippets.

@raftaar1191
Last active March 3, 2017 13:17
Show Gist options
  • Save raftaar1191/50e79116b56fdd6f4c441b4f67b448e8 to your computer and use it in GitHub Desktop.
Save raftaar1191/50e79116b56fdd6f4c441b4f67b448e8 to your computer and use it in GitHub Desktop.
Always show the upload container by default
<?php
// check if function does not exists
if ( ! function_exists( 'rtmedia_after_media_gallery_show_upload_button' ) ) {
function rtmedia_after_media_gallery_show_upload_button() {
// Please change the page_slug from here
$page_slug = 'file-upload';
if ( isset( $_GET[ $page_slug ] ) && ! empty( $_GET[ $page_slug ] ) ) {
?>
<style type="text/css">
#rtm-media-gallery-uploader {
display: block !important;
}
#rtm-media-options .rtmedia-upload-media-link {
display: none;
}
</style>
<?php
}
}
}
add_action( 'rtmedia_after_media_gallery', 'rtmedia_after_media_gallery_show_upload_button', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment