Skip to content

Commit

Permalink
Improves compatibility with qTranslate-XT
Browse files Browse the repository at this point in the history
  • Loading branch information
cabrerahector committed Dec 27, 2019
1 parent c50027b commit f6f771a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Admin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ public function render_list($posts, $list = 'most-viewed')
<?php
foreach( $posts as $post ) { ?>
<li>
<a href="<?php echo get_permalink($post->id); ?>" class="wpp-title"><?php echo sanitize_text_field($post->title); ?></a>
<a href="<?php echo get_permalink($post->id); ?>" class="wpp-title"><?php echo sanitize_text_field(apply_filters('the_title', $post->title, $post->id)); ?></a>
<div>
<?php if ( 'most-viewed' == $list ) : ?>
<span><?php printf(_n('%s view', '%s views', $post->pageviews, 'wordpress-popular-posts' ), number_format_i18n($post->pageviews)); ?></span>
Expand Down
5 changes: 5 additions & 0 deletions src/Output.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ private function get_title(\stdClass $post_object, $post_id)
} else {
$title = $post_object->title;
}

// Run the_title filter so core/plugin title hooks can
// be applied to the post title
$title = apply_filters('the_title', $title, $post_object->id);

return apply_filters('wpp_the_title', $title, $post_object->id, $post_id);
}

Expand Down

0 comments on commit f6f771a

Please sign in to comment.