| @@ 498-509 (lines=12) @@ | ||
| 495 | * @param string|array $template_path |
|
| 496 | * @return object $this |
|
| 497 | **/ |
|
| 498 | public function show_on_template( $template_path ) { |
|
| 499 | if ( is_array( $template_path ) ) { |
|
| 500 | foreach ( $template_path as $path ) { |
|
| 501 | $this->show_on_template( $path ); |
|
| 502 | } |
|
| 503 | return $this; |
|
| 504 | } |
|
| 505 | ||
| 506 | $this->settings['show_on']['template_names'][] = $template_path; |
|
| 507 | ||
| 508 | return $this; |
|
| 509 | } |
|
| 510 | ||
| 511 | /** |
|
| 512 | * Hide the container from pages whose template has filename $template_path. |
|
| @@ 517-528 (lines=12) @@ | ||
| 514 | * @param string|array $template_path |
|
| 515 | * @return object $this |
|
| 516 | **/ |
|
| 517 | public function hide_on_template( $template_path ) { |
|
| 518 | if ( is_array( $template_path ) ) { |
|
| 519 | foreach ( $template_path as $path ) { |
|
| 520 | $this->hide_on_template( $path ); |
|
| 521 | } |
|
| 522 | return $this; |
|
| 523 | } |
|
| 524 | ||
| 525 | $this->settings['show_on']['not_in_template_names'][] = $template_path; |
|
| 526 | ||
| 527 | return $this; |
|
| 528 | } |
|
| 529 | ||
| 530 | /** |
|
| 531 | * Show the container only on hierarchical posts of level $level. |
|