From 822d95a3cb8c931fd3526a4816b49d2956bc6af5 Mon Sep 17 00:00:00 2001 From: Jack Barker Date: Thu, 17 Sep 2020 17:26:14 +1000 Subject: [PATCH 1/2] Address issue #59 - CWS_WP_Help_Plugin::api_slurp() never registers the wp-help post type --- classes/plugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/plugin.php b/classes/plugin.php index b9cab0f..ab8e0c5 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -342,6 +342,10 @@ public function api_slurp() { return; $result = wp_remote_get( add_query_arg( 'time', time(), $this->get_option( 'slurp_url' ) ) ); if ( $result['response']['code'] == 200 ) { + + // Ensure that our post type is registered prior to any operations that might get executed downstream + $this->register_post_type(); + $topics = new WP_Query( array( 'post_type' => self::POST_TYPE, 'posts_per_page' => -1, 'post_status' => 'publish' ) ); $source_id_to_local_id = array(); if ( $topics->posts ) { From 5cd925be883c54a405c5b2b63613dd2f0afaf401 Mon Sep 17 00:00:00 2001 From: Jack Barker Date: Thu, 15 Oct 2020 20:22:10 +1100 Subject: [PATCH 2/2] Update plugin.php remove whitespace change --- classes/plugin.php | 1 - 1 file changed, 1 deletion(-) diff --git a/classes/plugin.php b/classes/plugin.php index 12353fb..e11bc9a 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -385,7 +385,6 @@ public function api_slurp() { 'posts_per_page' => -1, 'post_status' => 'publish', ) ); - $source_id_to_local_id = array(); if ( $topics->posts ) { foreach ( $topics->posts as $p ) {