File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -116,14 +116,12 @@ public function init() {
116116 // a last query time. This handles upgrades from < 1.9.7.4 where resources
117117 // would never expire.
118118 if ( ! $ this ->last_queried ) {
119- $ this ->refresh ();
120- return ;
119+ return $ this ->refresh ();
121120 }
122121
123122 // If the resources have expired, refresh them now.
124123 if ( time () > ( $ this ->last_queried + $ this ->cache_duration ) ) {
125- $ this ->refresh ();
126- return ;
124+ return $ this ->refresh ();
127125 }
128126
129127 }
@@ -344,13 +342,13 @@ public function exist() {
344342 *
345343 * @since 1.0.0
346344 *
347- * @return bool| WP_Error|array
345+ * @return WP_Error|array
348346 */
349347 public function refresh () {
350348
351349 // Bail if no API class was defined.
352350 if ( ! $ this ->api ) {
353- return false ;
351+ return new WP_Error ( ' convertkit_resource_refresh_error ' , ' Connect the Plugin to your Kit account to refresh resources. ' ) ;
354352 }
355353
356354 // Fetch resources.
You can’t perform that action at this time.
0 commit comments