Make WP update terms count for all items #318

This commit is contained in:
leogermani 2019-10-23 20:08:00 -03:00 committed by vnmedeiros
parent 678f69f26a
commit 56b9e76aa1
2 changed files with 116 additions and 113 deletions

View File

@ -81,6 +81,7 @@ class Taxonomy extends Entity {
'rewrite' => [
'slug' => $this->get_slug()
],
'update_count_callback' => '_update_generic_term_count'
);
if (taxonomy_exists($this->get_db_identifier())){

View File

@ -422,13 +422,13 @@ class Taxonomies extends TAINACAN_UnitTestCase {
$collection_1 = $this->tainacan_entity_factory->create_entity(
'collection',
array( 'name' => 'test-1' ),
array( 'name' => 'test-1', 'status' => 'publish', ),
true
);
$collection_2 = $this->tainacan_entity_factory->create_entity(
'collection',
array( 'name' => 'test-2' ),
array( 'name' => 'test-2', 'status' => 'publish', ),
true
);
@ -523,7 +523,8 @@ class Taxonomies extends TAINACAN_UnitTestCase {
array(
'title' => 'item teste',
'description' => 'adasdasdsa',
'collection' => $collection_1
'collection' => $collection_1,
'status' => 'publish'
),
true
);
@ -543,7 +544,8 @@ class Taxonomies extends TAINACAN_UnitTestCase {
array(
'title' => 'item teste',
'description' => 'adasdasdsa',
'collection' => $collection_2
'collection' => $collection_2,
'status' => 'private'
),
true
);