Function Reference: geodir_cpt_post_type_link


Filter if the location should be added to the url, and dont add if location is locationless.


(bool) (required) If the location is set to be added to the url or not.

Default: None
(WP_Post) (required) Post object.

Default: current post
(string) (required) The post type of the post being tested.

Default: None

Return Values

  • False if CPT is locationless.

Change Log

Since: 1.1.9

Source File

geodir_cpt_post_type_link() is located in geodir_custom_posts/geodir_cp_functions.php [Line: 1133]

Source Code

function geodir_cpt_post_type_link( $active, $post_type, $post_obj ) {

	// if the post type is locationless then set to false so the location is not added to the url.
	if ( geodir_cpt_no_location( $post_type ) ) {
        $active = false;

    return $active;