Skip to content

Commit

Permalink
feat: add a filter on terms so other plugins can add classes (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoo authored Sep 21, 2021
1 parent 54ad5b7 commit 28c0fde
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/class-newspack-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,15 @@ public static function get_term_classes( $post_id ) {
$classes[] = 'type-' . $post_type;
}

/**
* Filter the array of class names before applying them to the HTML.
*
* @param array $classes Array of term class names.
*
* @return array Filtered array of term class names.
*/
$classes = apply_filters( 'newspack_blocks_term_classes', $classes );

return implode( ' ', $classes );
}

Expand Down

0 comments on commit 28c0fde

Please sign in to comment.