| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | public static function getExcerpt( |
||
| 20 | $postId, |
||
| 21 | $len = 50, |
||
| 22 | $force = false, |
||
| 23 | $readmore = "Read More", |
||
| 24 | $strip = true, |
||
| 25 | $end = "…" |
||
| 26 | ) { |
||
| 27 | global $post; |
||
| 28 | $post = get_post($postId); |
||
| 29 | setup_postdata($post, null, false); |
||
| 30 | $timberPost = new Post($post); |
||
| 31 | $excerpt = $timberPost->get_preview($len, $force, $readmore, $strip, $end); |
||
| 32 | wp_reset_postdata($post); |
||
| 33 | return $excerpt; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |