dozent_course_post_class( array $classes, string|array $class = '', int $post_id )
Adds extra post classes for products via the WordPress post_class hook, if used.
Parameters
- $classes
-
(array) (Required) Current classes.
- $class
-
(string|array) (Optional) Additional class.
Default value: ''
- $post_id
-
(int) (Required) Post ID.
Return
(array)
Source
File: includes/template-functions.php
function dozent_course_post_class( $classes, $class = '', $post_id = 0 ) { $post_type = get_post_type( $post_id ); if ( ! $post_id || ! in_array( $post_type, array( 'dozent_course', 'dozent_lecture' ), true ) ) { return $classes; } $classes[] = $post_type; $classes[] = $post_type . '-' . $post_id; $key = array_search( 'hentry', $classes, true ); if ( false !== $key ) { unset( $classes[ $key ] ); } return $classes; }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |