Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't default to the post post type, if no other post types are selected #247

Merged
merged 5 commits into from
Oct 26, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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