Function Reference: geodir_cpt_has_rating_disabled

Summary

Check review star disabled for certain CPT.

Parameters

$post_type
(string|int) (required) WP post type or Post ID or WP texonomy. Ex: gd_place.

Default: None
$taxonomy
(bool) (required) Whether $post_type is taxonomy or not.

Default: None

Return Values

(bool)
  • True if review star disabled, otherwise false.

Change Log

Since: 1.6.16

Source File

geodir_cpt_has_rating_disabled() is located in geodirectory-functions/custom_functions.php [Line: 2954]

Source Code

function geodir_cpt_has_rating_disabled( $post_type = '', $taxonomy = false ) {
	$post_types = geodir_rating_disabled_post_types();

	if ( empty( $post_types ) ) {
		return false;
	}

	if ( is_int( $post_type ) ) {
		$post_type = get_post_type( $post_type );
	}

	if ( $taxonomy && !empty( $post_types ) ) {
		$posttypes = array();

		foreach ( $post_types as $posttype ) {
			$posttypes[] = $posttype . 'category';
			$posttypes[] = $posttype . '_tags';
		}

		$post_types = $posttypes;
	}

	$return = false;
	if ( $post_type != '' && !empty( $post_types ) && in_array( $post_type, $post_types ) ) {
		$return = true;
	}

	return $return;
}