Skip to content

Commit 36e1fc4

Browse files
authored
Merge branch 'develop' into filip/v19/adjust-terms-task-description
2 parents 4e27a5b + d9d9d54 commit 36e1fc4

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

classes/suggested-tasks/providers/class-improve-pdf-handling.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function should_add_task() {
9292
[
9393
'post_type' => 'attachment',
9494
'post_mime_type' => 'application/pdf',
95-
'post_status' => 'publish',
95+
'post_status' => 'inherit',
9696
'posts_per_page' => static::MIN_PDF_FILES + 1, // We want to get at least 11 PDF files to be sure we have enough.
9797
'fields' => 'ids',
9898
]
@@ -101,7 +101,7 @@ public function should_add_task() {
101101
\progress_planner()->get_utils__cache()->set( 'pdf_files_count', $pdf_files_count, DAY_IN_SECONDS );
102102
}
103103

104-
return static::MIN_PDF_FILES < $pdf_files_count;
104+
return static::MIN_PDF_FILES < (int) $pdf_files_count;
105105
}
106106

107107
/**

classes/suggested-tasks/providers/class-remove-terms-without-posts.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ public function init() {
115115
* @return void
116116
*/
117117
public function maybe_remove_irrelevant_tasks( $object_id, $terms, $tt_ids, $taxonomy, $append, $old_tt_ids ) {
118+
119+
$taxonomy_object = \get_taxonomy( $taxonomy );
120+
121+
// Check if the taxonomy is public, we are not interested in non-public taxonomies (also our data collector doesn't track non-public taxonomies).
122+
if ( ! $taxonomy_object || ! $taxonomy_object->public ) {
123+
return;
124+
}
125+
118126
foreach ( \progress_planner()->get_suggested_tasks_db()->get_tasks_by( [ 'provider_id' => $this->get_provider_id() ] ) as $task ) {
119127
/**
120128
* The task post object.

classes/suggested-tasks/providers/class-update-term-description.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ public function init() {
107107
* @return void
108108
*/
109109
public function maybe_remove_irrelevant_tasks( $term, $tt_id, $taxonomy, $deleted_term, $object_ids ) {
110+
111+
$taxonomy_object = \get_taxonomy( $taxonomy );
112+
113+
// Check if the taxonomy is public, we are not interested in non-public taxonomies (also our data collector doesn't track non-public taxonomies).
114+
if ( ! $taxonomy_object || ! $taxonomy_object->public ) {
115+
return;
116+
}
117+
110118
$pending_tasks = \progress_planner()->get_suggested_tasks_db()->get_tasks_by( [ 'provider_id' => $this->get_provider_id() ] );
111119

112120
if ( ! $pending_tasks ) {

0 commit comments

Comments
 (0)