Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. add_action( 'slt_cf_check_scope', 'my_scope_check', 10, 7 );
  2. function my_scope_check( $scope_match, $request_type, $scope, $object_id, $scope_key, $scope_value, $field ) {
  3.    
  4.     $scope_match = false;
  5.    
  6.     if ( $scope_key == 'pageFeatureImg' && is_page_template('pageFeatureImg.php') ) {
  7.         $scope_match = true;
  8.     } elseif ( $scope_key == 'pageHalfImage' && is_page_template('pageHalfImage.php') ) {
  9.         $scope_match = true;
  10.     } elseif ( $scope_key == 'pageDefault' && !is_page_template() ) {
  11.         $scope_match = true;
  12.     } else {
  13.         $scope_match = false;
  14.     }
  15.  
  16.     return $scope_match;
  17.        
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement