Why There Is No "get content by ID" Function
-
When i need to get content of a post with ID, I’m always using this function :
function getContentByID($id) { //https://wordpress.stackexchange.com/questions/9667/get-wordpress-post-content-by-post-id $content_post = get_post($id); $content = $content_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); return $content; }
Can you tell me, why there isn’t any core function for this ? There are functions like get_the_title($id), get_the_category($id) …
- The topic ‘Why There Is No "get content by ID" Function’ is closed to new replies.