Skip to content

Commit

Permalink
Merge pull request #247 from 10up/feature/supported-post-types
Browse files Browse the repository at this point in the history
Don't default to the `post` post type, if no other post types are selected
  • Loading branch information
jeffpaul committed Oct 26, 2020
2 parents a9d1b98 + f11a992 commit 3bf3899
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions includes/Classifai/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ function get_supported_post_types() {
}
}

if ( empty( $post_types ) ) {
$post_types = [ 'post' ];
}

/**
* Filter post types supported for language processing.
*
Expand Down
2 changes: 1 addition & 1 deletion tests/Classifai/HelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function test_it_has_plugin_settings() {

function test_it_has_default_supported_post_types() {
$actual = get_supported_post_types();
$this->assertEquals( [ 'post' ], $actual );
$this->assertEquals( [], $actual );
}

function test_it_can_lookup_supported_post_types_from_option() {
Expand Down
4 changes: 4 additions & 0 deletions tests/Classifai/Taxonomy/TaxonomyFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ function test_it_can_build_all_supported_taxonomies() {
}

function test_it_connects_watson_taxonomies_to_post_type() {
add_filter( 'classifai_post_types', function() {
return [ 'post' ];
} );

$this->factory->build_all();

$actual = get_object_taxonomies( 'post' );
Expand Down

0 comments on commit 3bf3899

Please sign in to comment.