Skip to content
GitLab
Explore
Sign in
Commits on Source (3)
Apply the_content filters to post content
· aa21c635
ale
authored
Oct 08, 2021
aa21c635
Get published_at from the post itself
· 27d021da
ale
authored
Oct 08, 2021
27d021da
Add an "excerpt" column
· 75444be7
ale
authored
Oct 08, 2021
75444be7
Hide whitespace changes
Inline
Side-by-side
ai-global-activity.php
View file @
75444be7
...
...
@@ -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_
conten
t
=
get_the_
content
(
'more...'
,
true
,
$post
);
$post_content
=
apply_filters
(
'the_content'
,
get_the_content
(
'more...'
,
false
,
$post
)
);
$post_
excerp
t
=
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
,
)
);
}
...
...