AnsPress_Theme::question_answer_post_class( array $classes )
Description #
Add answer-seleted class in post_class.
Parameters #
- $classesarray (Required) Post class attribute.
Source #
File: includes/class-theme.php
public static function question_answer_post_class( $classes ) { global $post; if ( ! $post ) { return $classes; } if ( 'question' === $post->post_type ) { if ( ap_have_answer_selected( $post->ID ) ) { $classes[] = 'answer-selected'; } if ( ap_is_featured_question( $post->ID ) ) { $classes[] = 'featured-question'; } $classes[] = 'answer-count-' . ap_get_answers_count(); } elseif ( 'answer' === $post->post_type ) { if ( ap_is_selected( $post->ID ) ) { $classes[] = 'best-answer'; } if ( ! ap_user_can_read_answer( $post ) ) { $classes[] = 'no-permission'; } } return $classes; }
Expand full source code Collapse full source code View on GitHub: includes/class-theme.php:102
Add your comment