1142 posts It's in the pipeline!
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Author Level 11
+9 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 :)

743 posts
  • Elite Author
  • Weekly Top Seller
  • Featured Item
  • Most Wanted Winner
+5 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?

1142 posts It's in the pipeline!
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Author Level 11
+9 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