Advertisement
verygoodplugins

Untitled

Jun 11th, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. add_filter( 'sidebars_widgets', 'wpse17681_sidebars_widgets' );
  2.  
  3. function wpse17681_sidebars_widgets( $sidebars_widgets ) {
  4.     if ( !is_admin() ) {
  5.  
  6.         foreach ( $sidebars_widgets as $sidebar_id => &$widgets ) {
  7.  
  8.             foreach ( $widgets as $idx => $widget_id ) {
  9.  
  10.                 if($sidebar_id == 'sidebar-1' && $widget_id == 'text-3' && !wp_fusion()->user->has_tag('Tag Name'))
  11.                     unset( $widgets[$idx] );
  12.  
  13.             }
  14.  
  15.         }
  16.     }
  17.  
  18.     return $sidebars_widgets;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement