This commit removes the method Posts::getTerms() as it existed to add a compatibility layer for sites running WP < 4.5.0 and we don't support this version anymore. The signature of the WP get_terms() function was changed in version 4.5.0 and that is why this compatibility layer was needed. The integration test class for this method was also removed. The only place where this method was used, AutomatedLatestContent::getTerms(), now call WPFunctions->getTerms() directly. A very basic integration test was added to cover the happy path of AutomatedLatestContent::getTerms(). [MAILPOET-4225]
16 lines
358 B
PHP
16 lines
358 B
PHP
<?php
|
|
|
|
namespace MailPoet\WP;
|
|
|
|
use MailPoet\WP\Functions as WPFunctions;
|
|
|
|
class Posts {
|
|
public static function getTypes($args = [], $output = 'names', $operator = 'and') {
|
|
$defaults = [
|
|
'exclude_from_search' => false,
|
|
];
|
|
$args = array_merge($defaults, $args);
|
|
return WPFunctions::get()->getPostTypes($args, $output, $operator);
|
|
}
|
|
}
|