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