AnsPress_Theme::remove_hentry_class( array $post_classes, array $class_name, integer $post_id )

Description #

Remove hentry class from question, answers and main pages .

Parameters #

  • $post_classes
    array (Required) Post classes.
  • $class_name
    array (Required) An array of additional classes added to the post.
  • $post_id
    integer (Required) Post ID.

Changelog #

VersionDescription
4.1.0Introduced.

Source #

File: includes/class-theme.php

	public static function remove_hentry_class( $post_classes, $class_name, $post_id ) {
		$_post = ap_get_post( $post_id );

		if ( $_post && ( in_array( $_post->post_type, array( 'answer', 'question' ), true ) || in_array( $_post->ID, ap_main_pages_id() ) ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
			return array_diff( $post_classes, array( 'hentry' ) );
		}

		return $post_classes;
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment