| @@ 382-389 (lines=8) @@ | ||
| 379 | * @param string $category_slug |
|
| 380 | * @return object $this |
|
| 381 | **/ |
|
| 382 | public function show_on_category( $category_slug ) { |
|
| 383 | $this->and_when( 'post_term', '=', array( |
|
| 384 | 'value' => $category_slug, |
|
| 385 | 'field' => 'slug', |
|
| 386 | 'taxonomy' => 'category', |
|
| 387 | ) ); |
|
| 388 | return $this; |
|
| 389 | } |
|
| 390 | ||
| 391 | /** |
|
| 392 | * Show the container only on posts which have term $term_slug from the $taxonomy_slug taxonomy. |
|
| @@ 399-406 (lines=8) @@ | ||
| 396 | * @param string $term_slug |
|
| 397 | * @return object $this |
|
| 398 | **/ |
|
| 399 | public function show_on_taxonomy_term( $term_slug, $taxonomy_slug ) { |
|
| 400 | $this->and_when( 'post_term', '=', array( |
|
| 401 | 'value' => $term_slug, |
|
| 402 | 'field' => 'slug', |
|
| 403 | 'taxonomy' => $taxonomy_slug, |
|
| 404 | ) ); |
|
| 405 | return $this; |
|
| 406 | } |
|
| 407 | ||
| 408 | /** |
|
| 409 | * Sets the meta box container context |
|