verygoodplugins

Untitled

Sep 17th, 2020
625
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ignore_unknown_tags( $tags ) {
  2.  
  3.     $available_tags = wp_fusion()->settings->get( 'available_tags' );
  4.  
  5.     foreach ( $tags as $i => $tag_id ) {
  6.         if ( ! isset( $available_tags[ $tag_id ] ) ) {
  7.             unset( $tags[ $i ] );
  8.         }
  9.     }
  10.  
  11.     return $tags;
  12.  
  13. }
  14.  
  15. add_filter( 'wpf_api_get_tags_result', 'ignore_unknown_tags' );
RAW Paste Data