@@ 264-275 (lines=12) @@ | ||
261 | break; |
|
262 | ||
263 | // show_on_template |
|
264 | case 'template_names': |
|
265 | if ( empty( $value ) || $post->post_type != 'page' ) { |
|
266 | break; |
|
267 | } |
|
268 | $current_template = get_post_meta( $post_id, '_wp_page_template', 1 ); |
|
269 | ||
270 | if ( ! in_array( $current_template, $value ) ) { |
|
271 | $valid = false; |
|
272 | break 2; |
|
273 | } |
|
274 | ||
275 | break; |
|
276 | ||
277 | // hide_on_template |
|
278 | case 'not_in_template_names': |
|
@@ 278-289 (lines=12) @@ | ||
275 | break; |
|
276 | ||
277 | // hide_on_template |
|
278 | case 'not_in_template_names': |
|
279 | if ( empty( $value ) || $post->post_type != 'page' ) { |
|
280 | break; |
|
281 | } |
|
282 | $current_template = get_post_meta( $post_id, '_wp_page_template', 1 ); |
|
283 | ||
284 | if ( in_array( $current_template, $value ) ) { |
|
285 | $valid = false; |
|
286 | break 2; |
|
287 | } |
|
288 | ||
289 | break; |
|
290 | } |
|
291 | } |
|
292 |