Skip to content

Commit 798a049

Browse files
Fix error in most popular posts diagram showing multiple pages with the same title (#42)
1 parent 4d75bfc commit 798a049

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Version 2.x
99

10+
### Version 2.6.2
11+
* Bugfix: Error in most popular posts diagram showing multiple pages with the same title
12+
1013
### Version 2.6.1
1114
* Update tooltip library (switch to more recent fork)
1215
* Fix issues on WordPress multisite installations (set capabilities and links on the content page)

views/content.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class="<?php eefstatify_echo_tab_class( $selected_post_type === $post_type ); ?>
7878
</form>
7979
<?php if ( count( $views_per_post ) === 0 ) { ?>
8080
<p><?php esc_html_e( 'No data available.', 'extended-evaluation-for-statify' ); ?></p>
81-
<?php } else { ?>
81+
<?php } else { ?>
8282
<section>
8383
<?php
8484
$legend = [];
@@ -98,8 +98,8 @@ class="<?php eefstatify_echo_tab_class( $selected_post_type === $post_type ); ?>
9898
'#chart-popular-content',
9999
[
100100
<?php
101-
foreach ( $views_per_post_for_diagram as $post ) {
102-
echo "['" . esc_js( eefstatify_get_post_title_from_url( $post['url'] ) ) . "'," . esc_js( $post['count'] ) . '],';
101+
foreach ( $views_per_post_for_diagram as $index => $post ) {
102+
echo "['" . esc_js( $index ) . "'," . esc_js( $post['count'] ) . '],';
103103
}
104104
?>
105105
]

0 commit comments

Comments
 (0)