| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 18 | public function is_fulfilled( $environment ) { |
||
| 19 | $post_id = $environment['post_id']; |
||
| 20 | $post = $environment['post']; |
||
| 21 | $ancestors = array(); |
||
| 22 | |||
| 23 | if ( $post ) { |
||
| 24 | $ancestors = array_map( 'intval', get_ancestors( $post_id, $post->post_type ) ); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $this->compare( |
||
| 28 | $ancestors, |
||
| 29 | $this->get_comparison_operator(), |
||
| 30 | $this->get_value() |
||
| 31 | ); |
||
| 32 | } |
||
| 33 | } |