Advertisement
verygoodplugins

Untitled

Jan 24th, 2020
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. function override_post_access_settings( $post_restrictions, $post_id ) {
  2.  
  3.     if ( is_page( 'wp-fusion-a' ) && ! empty( $post_restrictions['allow_tags'] ) ) {
  4.  
  5.         foreach ( $post_restrictions['allow_tags'] as $i => $tag ) {
  6.  
  7.             if ( strpos( $tag, 'Unlock' ) !== false ) {
  8.  
  9.                 unset( $post_restrictions['allow_tags'][ $i ] );
  10.  
  11.             }
  12.  
  13.         }
  14.  
  15.     }
  16.  
  17.     return $post_restrictions;
  18.  
  19. }
  20.  
  21. add_filter( 'wpf_post_access_meta', 'override_post_access_settings', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement