Advertisement
verygoodplugins

Untitled

Mar 19th, 2020
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. function wpf_elementor_can_access( $can_access, $element ) {
  2.  
  3.   $widget_tags = $element->get_settings( 'wpf_tags' );
  4.  
  5.   if ( ! empty( $widget_tags ) && in_array( 'DYNAMIC', $widget_tags ) ) {
  6.  
  7.     $can_access = false;
  8.  
  9.     global $post;
  10.  
  11.     if ( wp_fusion()->user->has_tag( 'Listing - ' . $post->ID ) ) {
  12.       $can_access = true;
  13.     }
  14.  
  15.   }
  16.  
  17.   return $can_access;
  18.  
  19. }
  20.  
  21. add_filter( 'wpf_elementor_can_access', 'wpf_elementor_can_access', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement