Skip to content

Commit

Permalink
The include parameter in get_terms actually behaves like an "in" and …
Browse files Browse the repository at this point in the history
…therefor it is mostly useless and as a result removing the option from the API #87
  • Loading branch information
markkap committed Feb 6, 2019
1 parent 7eaae8c commit 4895bfa
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/wp-includes/calmpress/class-post-authors-as-taxonomy.php
Expand Up @@ -226,15 +226,13 @@ public static function combined_authors_url( \WP_Post $post ) : string {
*
* @param bool $include_empty Indicates if authors with no posts should be returned.
* @param calmpress\post_authors\Post_Author[] $exclude Authors to always exclude.
* @param calmpress\post_authors\Post_Author[] $include Authors to always include.
*
* @return calmpress\post_authors\Post_Author[] The authors.
*/
public static function get_authors( int $number,
int $sort_type,
bool $include_empty,
array $exclude,
array $include ) {
array $exclude ) {

$args['number'] = $number;

Expand Down Expand Up @@ -274,11 +272,6 @@ public static function get_authors( int $number,
$args['exclude'][] = $author->term_id();
}

$args['include'] = [];
foreach ( $include as $author ) {
$args['include'][] = $author->term_id();
}

$authors = get_terms( self::TAXONOMY_NAME, $args );

return array_map( function ( $term ) {
Expand Down

0 comments on commit 4895bfa

Please sign in to comment.