Remove WP < 4.5.0 compatibility code
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]
This commit is contained in:
@ -59,8 +59,8 @@ class AutomatedLatestContent extends APIEndpoint {
|
||||
'order' => 'ASC',
|
||||
];
|
||||
|
||||
$args = $this->wp->applyFilters('mailpoet_search_terms_args', $args);
|
||||
$terms = WPPosts::getTerms($args);
|
||||
$args = (array)$this->wp->applyFilters('mailpoet_search_terms_args', $args);
|
||||
$terms = WPFunctions::get()->getTerms($args);
|
||||
|
||||
return $this->successResponse(array_values($terms));
|
||||
}
|
||||
|
Reference in New Issue
Block a user