Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filters to identifier, title and link #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions disqus/disqus.php
Original file line number Diff line number Diff line change
Expand Up @@ -1439,17 +1439,17 @@ function dsq_hmacsha1($data, $key) {
}

function dsq_identifier_for_post($post) {
return $post->ID . ' ' . $post->guid;
return apply_filters('dsq_identifier_for_post', $post->ID . ' ' . $post->guid, $post);
}

function dsq_title_for_post($post) {
$title = get_the_title($post);
$title = strip_tags($title, DISQUS_ALLOWED_HTML);
return $title;
return apply_filters('dsq_title_for_post', $title, $post);
}

function dsq_link_for_post($post) {
return get_permalink($post);
return apply_filters('dsq_link_for_post', get_permalink($post), $post);
}

function dsq_does_need_update() {
Expand Down
2 changes: 1 addition & 1 deletion disqus/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function dsq_export_wp($post, $comments=null) {
setup_postdata($post); ?>
<item>
<title><?php echo apply_filters('the_title_rss', $post->post_title); ?></title>
<link><?php the_permalink_rss() ?></link>
<link><?php echo dsq_link_for_post($post); ?></link>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php echo dsq_export_wxr_cdata(get_the_author()); ?></dc:creator>
<guid isPermaLink="false"><?php the_guid(); ?></guid>
Expand Down