Skip to content
Commits on Source (1)
......@@ -74,7 +74,7 @@ function ai_activity_publish_post($post_id) {
}
$post_title = get_the_title($post);
$post_url = get_post_permalink($post);
$post_url = get_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);
......@@ -125,6 +125,16 @@ function ai_activity_get_next_page_link() {
return "?" . AI_ACTIVITY_PAGE_ARG_NAME . "=" . ($p + 1);
}
function ai_activity_get_blog_name($blog_id) {
$blog_details = get_blog_details($blog_id);
$blog_name = $blog_details->blogname;
if (! $blog_name) {
preg_match('/^https?:\/\/([^.]+)/', get_site_url($blog_id), $matches);
$blog_name = $matches[1];
}
return $blog_name;
}
function ai_activity_get_latest_posts($offset, $limit) {
global $wpdb;
......@@ -170,9 +180,9 @@ function ai_activity_display_recent_posts($tmp_number, $tmp_title_characters, $t
}
if ($show_blog) {
$blog_details = get_blog_details($blog_id);
$blog_name = esc_html(ai_activity_get_blog_name($blog_id));
$site_url = get_site_url($blog_id);
$html .= " (<a href=\"{$site_url}\">{$blog_details->blogname}</a>)";
$html .= " (<a href=\"{$site_url}\">{$blog_name}</a>)";
}
$html .= "</div>";
}
......