WordPress.org

Make WordPress Core

Ticket #37114: 37114.2.diff

File 37114.2.diff, 1.1 KB (added by desrosj, 2 years ago)
  • src/wp-includes/post-template.php

     
    526526        // hentry for hAtom compliance
    527527        $classes[] = 'hentry';
    528528
    529         // All public taxonomies
     529        // All public taxonomies.
    530530        $taxonomies = get_taxonomies( array( 'public' => true ) );
     531
     532        /**
     533         * Filters the taxonomies to generate classes for each individual term.
     534         *
     535         * Default is all public taxonomies registered to the post type.
     536         *
     537         * @since 4.9.9
     538         *
     539         * @param array   $taxonomies List of all public taxonomies to generate classes for.
     540         * @param array   $classes    An array of post class names.
     541         * @param array   $class      An array of additional class names added to the post.
     542         * @param int     $post_id    The post ID.
     543         */
     544        $taxonomies = apply_filters( 'post_class_taxonomies', $taxonomies, $classes, $class, $post->ID );
     545
    531546        foreach ( (array) $taxonomies as $taxonomy ) {
    532547                if ( is_object_in_taxonomy( $post->post_type, $taxonomy ) ) {
    533548                        foreach ( (array) get_the_terms( $post->ID, $taxonomy ) as $term ) {