Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Add_On::uninstall_real()

Actually performs the uninstall


Return Return

(string|WP_Error) Success message or an error object.


Top ↑

Source Source

File: includes/models/model.llms.add-on.php

	private function uninstall_real() {

		$type = $this->get_type();

		if ( ! in_array( $type, array( 'plugin', 'theme' ), true ) ) {
			// Translators: %s = add-on type.
			return new WP_Error( 'uninstall-invalid-type', sprintf( __( 'Cannot uninstall "%s" type add-ons.', 'lifterlms' ), $type ) );
		}

		$file = $this->get( 'update_file' );

		if ( 'plugin' === $type ) {
			uninstall_plugin( $file );
			$del = delete_plugins( array( $file ) );
		} else {
			$del = delete_theme( $file );
		}

		if ( is_wp_error( $del ) ) {
			return $del;
		}

		// Translators: %s = Add-on title.
		return sprintf( __( '%s was successfully uninstalled.', 'lifterlms' ), $this->get( 'title' ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.1.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.