Advertisement
sbrajesh

Disable Video Upload in bp-gallery

Apr 6th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. add_filter("bp_gallery_is_method_enabled","bp_gallery_disable_upload_for_video_gallery",10,3);
  3. function bp_gallery_disable_upload_for_video_gallery($is_enabled,$method,$gallery){
  4.  
  5. if($method=="upload"&&$gallery->gallery_type=="video")
  6. return false;
  7. return $is_enabled;
  8. }
  9.  
  10. //for create gallery and pointing to automatic upload link fix
  11. add_filter("bp_get_media_upload_link","fix_gallery_upload_link",10,2);
  12. function fix_gallery_upload_link($link,$gallery){
  13. if(bp_gallery_is_method_enabled("upload", $gallery))
  14.     return $link;
  15. //if upload method is not enabled, we assume add from web is enabled
  16.  
  17. $link=bp_get_media_add_from_web_link($gallery);
  18. return $link;
  19.  
  20. }
  21.  
  22. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement