Created
June 23, 2016 18:20
-
-
Save MaximeCulea/d8bfd8c5e0fed5b1220554d5b3a29a1f to your computer and use it in GitHub Desktop.
Get the excerpt.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the given post_id excerpt | |
* @param $post_id | |
* | |
* @return string | |
* @author Maxime CULEA | |
*/ | |
public static function get_the_excerpt( $post_id ) { | |
$post = get_post( $post_id ); | |
return ! empty( $post->post_excerpt ) ? $post->post_excerpt : ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment