963 posts It's in the pipeline!
  • Elite Author
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Exclusive Author
  • Microlancer Beta Tester
  • Author had a Free File of the Month
+2 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
  • Has been a member for 5-6 years
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Poland
  • Referred between 10 and 49 users
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?

963 posts It's in the pipeline!
  • Elite Author
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Exclusive Author
  • Microlancer Beta Tester
  • Author had a Free File of the Month
+2 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