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