Advertisement
verygoodplugins

Untitled

Aug 29th, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. function process_tag_removals( $tags, $user_id ) {
  2.  
  3.     foreach( $tags as $i => $tag ) {
  4.  
  5.         if( strpos($tag, 'REMOVE_') !== false ) {
  6.  
  7.             $remove = str_replace('REMOVE_', '', $tag);
  8.             wp_fusion()->user->remove_tags( array( $remove ) );
  9.             unset( $tags[$i] );
  10.            
  11.         }
  12.  
  13.     }
  14.  
  15.     return $tags;
  16.  
  17. }
  18.  
  19. add_filter( 'wpf_apply_tags', 'process_tag_removals', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement