Skip to content
Commits on Source (3)
......@@ -29,6 +29,7 @@ function ai_activity_install() {
title text,
author text,
content text,
excerpt text,
url text,
published_at datetime DEFAULT current_timestamp(),
PRIMARY KEY (blog_id,post_id),
......@@ -72,9 +73,10 @@ function ai_activity_publish_post($post_id) {
$post_title = get_the_title($post);
$post_url = get_post_permalink($post);
//$post_content = apply_filters('the_content', $post->post_content);
$post_content = get_the_content('more...', true, $post);
$post_content = apply_filters('the_content', get_the_content('more...', false, $post));
$post_excerpt = get_the_excerpt($post);
$post_author = apply_filters('the_author', $post->post_author);
$post_date = get_the_date('Y-m-d H:i:s', $post);
// If another entry for the same blog_id/post_id exists,
// we want to overwrite it (likely someone editing an already
......@@ -87,7 +89,9 @@ function ai_activity_publish_post($post_id) {
'post_id' => $post_id,
'author' => $post_author,
'content' => $post_content,
'excerpt' => $post_excerpt,
'url' => $post_url,
'published_at' => $post_date,
)
);
}
......