Code Duplication    Length = 15-15 lines in 3 locations

includes/acf/core/location.php 3 locations

@@ 119-133 (lines=15) @@
116
	function rule_match_current_user( $match, $rule, $options ) {
117
		
118
		// logged in
119
		if( $rule['value'] == 'logged_in' ) {
120
			
121
			if( $rule['operator'] == "==" ) {
122
				
123
				$match = is_user_logged_in();
124
					
125
			} elseif( $rule['operator'] == "!=" ) {
126
				
127
				$match = !is_user_logged_in();
128
					
129
			}
130
			
131
			return $match;
132
			
133
		}
134
		
135
		
136
		// front end
@@ 137-151 (lines=15) @@
134
		
135
		
136
		// front end
137
		if( $rule['value'] == 'viewing_front' ) {
138
			
139
			if( $rule['operator'] == "==" ) {
140
				
141
				$match = !is_admin();
142
					
143
			} elseif( $rule['operator'] == "!=" ) {
144
				
145
				$match = is_admin();
146
					
147
			}
148
			
149
			return $match;
150
			
151
		}
152
		
153
		
154
		// back end
@@ 155-169 (lines=15) @@
152
		
153
		
154
		// back end
155
		if( $rule['value'] == 'viewing_back' ) {
156
			
157
			if( $rule['operator'] == "==" ) {
158
				
159
				$match = is_admin();
160
					
161
			} elseif( $rule['operator'] == "!=" ) {
162
				
163
				$match = !is_admin();
164
					
165
			}
166
			
167
			return $match;
168
			
169
		}
170
		
171
		
172
        // return