PluginProbe
Tutor LMS – eLearning and online course solution / 3.8.2
Tutor LMS – eLearning and online course solution v3.8.2
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 4.0.0 3.9.15 3.9.14 3.9.13 3.9.12 3.9.11 trunk 1.0.0 1.0.0-alpha 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 All 191 releases
← All changes | classes/Permalink.php +0 -42 trunk3.8.2 View file →
@@ -96,47 +96,5 @@
96 96
97 97 delete_transient( self::TRANS_KEY );
98 98 }
99 99
100 - /**
101 - * Set or reset the permalink flag for Tutor LMS.
102 - *
103 - * Used to trigger permalink flush for Tutor LMS when certain upgrade
104 - * processes are completed. This function is typically called during
105 - * the upgrader_process_complete action hook.
106 - *
107 - * @since 4.0.0
108 - *
109 - * @param mixed $upgrader_object Upgrader instance.
110 - * @param array $options Extra arguments passed to the hook.
111 - * @param string $basename Plugin basename.
112 - * @param array $text_domain Text domain.
113 - *
114 - * @return void
115 - */
116 - public static function set_permalink_reset_flag( $upgrader_object, $options, $basename = '', $text_domain = '' ) {
117 - $our_plugin = empty( $basename ) ? tutor()->basename : $basename;
118 - $text_domain = empty( $text_domain ) ? 'tutor' : $text_domain;
119 -
120 - if ( ! is_a( $upgrader_object, 'WP_Upgrader' ) ) {
121 - return;
122 - }
123 -
124 - if ( is_array( $options ) && 'update' === $options['action'] && 'plugin' === $options['type'] && isset( $options['plugins'] ) ) {
125 - // Iterate through the plugins being updated and check if ours is there.
126 - foreach ( $options['plugins'] as $plugin ) {
127 - if ( $plugin === $our_plugin ) {
128 - self::set_permalink_flag();
129 - break;
130 - }
131 - }
132 - } else {
133 - $plugin_data = $upgrader_object->new_plugin_data ?? null;
134 - if ( is_array( $plugin_data ) && ! empty( $plugin_data['TextDomain'] ) ) {
135 - $new_text_domain = strtolower( $plugin_data['TextDomain'] );
136 - if ( $text_domain === $new_text_domain ) {
137 - self::set_permalink_flag();
138 - }
139 - }
140 - }
141 - }
142 100 }