PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.38
Timetics – Appointment Booking Calendar & Scheduling v1.0.38
1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 All 64 releases
← All changes | base/custom-endpoint.php +2 -17 1.0.58 → 1.0.38 View file →
@@ -4,11 +4,8 @@
4 4 *
5 5 * @package Timetics
6 6 */
7 7 namespace Timetics\Base;
8 -
9 -defined( 'ABSPATH' ) || exit;
10 -
11 8 use Timetics\Utils\Singleton;
12 9
13 10 class Custom_Endpoint {
14 11 use Singleton;
@@ -19,9 +16,8 @@
19 16 * @return void
20 17 */
21 18 public function init() {
22 19 add_action( 'init', [$this, 'register'] );
23 - add_action( 'init', [$this, 'maybe_flush_rules'], 99 );
24 20 }
25 21
26 22 /**
27 23 * Register all custom endpoints
@@ -33,22 +29,11 @@
33 29
34 30 foreach ( $endpoints as $endpoint ) {
35 31 add_rewrite_endpoint( $endpoint, EP_ALL );
36 32 }
37 - }
38 33
39 - /**
40 - * Flush rewrite rules once per plugin version (after upgrade or fresh install).
41 - *
42 - * @return void
43 - */
44 - public function maybe_flush_rules() {
45 - $stored = get_option( 'timetics_rewrite_version' );
46 -
47 - if ( defined( 'TIMETICS_VERSION' ) && $stored !== TIMETICS_VERSION ) {
48 - flush_rewrite_rules( false );
49 - update_option( 'timetics_rewrite_version', TIMETICS_VERSION, false );
50 - }
34 + // Flush rewrite rules after register all custom endpoints.
35 + flush_rewrite_rules( true );
51 36 }
52 37
53 38 /**
54 39 * Get all endpoints