@@ 251-262 (lines=12) @@ | ||
248 | break; |
|
249 | ||
250 | // show_on_template |
|
251 | case 'template_names': |
|
252 | if ( empty( $value ) || $post->post_type != 'page' ) { |
|
253 | break; |
|
254 | } |
|
255 | $current_template = get_post_meta( $post_id, '_wp_page_template', 1 ); |
|
256 | ||
257 | if ( ! in_array( $current_template, $value ) ) { |
|
258 | $valid = false; |
|
259 | break 2; |
|
260 | } |
|
261 | ||
262 | break; |
|
263 | ||
264 | // hide_on_template |
|
265 | case 'not_in_template_names': |
|
@@ 265-276 (lines=12) @@ | ||
262 | break; |
|
263 | ||
264 | // hide_on_template |
|
265 | case 'not_in_template_names': |
|
266 | if ( empty( $value ) || $post->post_type != 'page' ) { |
|
267 | break; |
|
268 | } |
|
269 | $current_template = get_post_meta( $post_id, '_wp_page_template', 1 ); |
|
270 | ||
271 | if ( in_array( $current_template, $value ) ) { |
|
272 | $valid = false; |
|
273 | break 2; |
|
274 | } |
|
275 | ||
276 | break; |
|
277 | } |
|
278 | } |
|
279 |