Skip to content
Snippets Groups Projects
Commit 75444be7 authored by ale's avatar ale
Browse files

Add an "excerpt" column

parent 27d021da
No related branches found
No related tags found
No related merge requests found
Pipeline #22100 passed
......@@ -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),
......@@ -73,6 +74,7 @@ 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', 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);
......@@ -87,6 +89,7 @@ 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,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment