| @@ -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 | } |