Function Reference: geodir_cpt_no_location

Summary

Check physical location disabled.

Parameters

$post_type
(string) (required) WP post type 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 physical location disabled, otherwise false.

Change Log

Since: 1.1.6

Source File

geodir_cpt_no_location() is located in geodir_custom_posts/geodir_cp_functions.php [Line: 955]

Source Code

function geodir_cpt_no_location( $post_type = '', $taxonomy = false ) {
	$post_types = get_option( 'geodir_cpt_disable_location' );
	
	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;
}