Advertisement
verygoodplugins

Untitled

Sep 17th, 2020
922
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  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' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement