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