Skip to content

Commit

Permalink
bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
jagdish1o1 committed Aug 1, 2024
1 parent f332ae5 commit 0741572
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions includes/class-listings-cpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function custom_rewrite_rules($rules)
foreach ($listings as $listing) {
$custom_uri = get_post_meta($listing->ID, 'custom_uri', true);
if ($custom_uri) {
$custom_uri = untrailingslashit($custom_uri); // Ensure no trailing slash
$new_rules[$custom_uri . '/?$'] = 'index.php?post_type=listings&p=' . $listing->ID;
}
}
Expand Down
3 changes: 2 additions & 1 deletion includes/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ public function update_custom_uri()
update_post_meta($listing->ID, 'custom_uri', $custom_uri . '/');
}
}

// Remove permalink cache
flush_rewrite_rules();
wp_send_json_success(array('message' => 'Custom URI updated for all published listings.'));
}
}
2 changes: 1 addition & 1 deletion wp-leadgen-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: WP Leadgen Pro
* Description: Plugin to integration with wp leadgen pro platform.
* Version: 1.0.7
* Version: 1.0.10
* Author: WP Leadgen Pro
* Author URI: https://wpleadgen.pro
* License: GPLv2 or later
Expand Down

0 comments on commit 0741572

Please sign in to comment.