WordPress.org

Make WordPress Core

Ticket #37114: 37144.1.patch

File 37144.1.patch, 1017 bytes (added by bordoni, 4 years ago)
  • src/wp-includes/post-template.php

     
    507507
    508508        // All public taxonomies
    509509        $taxonomies = get_taxonomies( array( 'public' => true ) );
     510
     511        /**
     512         * Filters which Taxonomies that will have it's terms returned on the `get_post_class`.
     513         *
     514         * By default it will use the public taxonomies.
     515         *
     516         * @since 4.7.0
     517         *
     518         * @param array   $taxonomies Public taxonomy names to show term classes for, array of strings.
     519         * @param WP_Post $post       Post object.
     520         * @param array   $classes    The classes that are going to be returned so far.
     521         */
     522        $taxonomies = apply_filters( 'post_class_taxonomies', $taxonomies, $post, $classes );
     523
    510524        foreach ( (array) $taxonomies as $taxonomy ) {
    511525                if ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
    512526                        foreach ( (array) get_the_terms( $post->ID, $taxonomy ) as $term ) {