Advertisement
bphelp

Combining PHP conditional with CSS to display items

May 23rd, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. <?php
  2. /* Prevent logged out users from accessing the search form */
  3. function bphelp_remove_searchform_for_logged_out_visitors() {
  4. if ( ! is_user_logged_in() ) {
  5. ?>
  6. <style type="text/css">
  7. form#search-form {
  8. display: none;
  9. }
  10.  
  11. </style>
  12. <?php
  13.  
  14. }
  15.  
  16. }
  17. add_action ('bp_head', 'bphelp_remove_searchform_for_logged_out_visitors');
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement