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