Skip to content

Commit

Permalink
Merge pull request #160 from alleyinteractive/fix/issue-159/fatal-fro…
Browse files Browse the repository at this point in the history
…ntend-trending-no-parsely-setup

Issue-159: Fatal on front end when trending is set as source but parsely not setup
  • Loading branch information
mogmarsh authored Mar 27, 2024
2 parents 736351a + c39b00c commit 80e4c2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `WP Curate` will be documented in this file.

## 1.8.1 - 2024-03-27

- Bug Fix: Query blocks set to ordery trending fatal when Parse.ly is not set up.

## 1.8.0 - 2024-03-19

- Enhancement: Integration with [WPGraphQL plugin](https://wordpress.org/plugins/wp-graphql/) to support custom GraphQL interface type and connection.
Expand Down
4 changes: 4 additions & 0 deletions src/features/class-parsely-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function add_parsely_trending_posts_query( array $posts, array $args ): a
* @return array<int> An array of post IDs.
*/
public function get_trending_posts( array $args ): array {
$parsely = $GLOBALS['parsely'];
if ( ! $parsely->api_secret_is_set() ) {
return [];
}
if ( ! class_exists( '\Parsely\Parsely' ) || ! isset( $GLOBALS['parsely'] ) || ! $GLOBALS['parsely'] instanceof Parsely ) {
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion wp-curate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WP Curate
* Plugin URI: https://github.com/alleyinteractive/wp-curate
* Description: Plugin to curate homepages and other landing pages
* Version: 1.8.0
* Version: 1.8.1
* Author: Alley Interactive
* Author URI: https://github.com/alleyinteractive/wp-curate
* Requires at least: 6.4
Expand Down

0 comments on commit 80e4c2c

Please sign in to comment.