1004 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says

Hi guys and girls, please help.

It’s killing me. I’m building Page template for users to submit new posts from front-end. I’m using wp_editor for post content, and I want them to be able to use Media buttons, however I don’t want them to see Media Library. This simple function does the thing:
function anonpost_media_upload_tabs( $tabs ) {
        unset( $tabs['gallery'] );
        unset( $tabs['library'] );
        return $tabs;
}
add_filter('media_upload_tabs','anonpost_media_upload_tabs');
I just want it to work on that particular page, but this of course removes this tab from everywhere. But that filter runs in some crazy way, and I’m unable to run it in any conditional function to run only on that page. Nothing works.

Help please :)

741 posts
  • Had an item featured on Envato Market
  • Won a Most Wanted contest
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
+4 more
Orbital_Themes says

What conditionals have you tried already? I think that the case could be that you’re adding conditionals that are not yet available because the media_upload_tabs runs very early. Maybe that’s something to investigate?

1004 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
+7 more
purethemes says

Indeed that’s why it happens. It runs early, and I can’t find any way to determine from where is it called.

by
by
by
by
by
by