LLMS_Helper_Add_On::get_download_info()

Retrieve download information for an add-on


Return Return

(WP_Error|array)


Top ↑

Source Source

File: libraries/lifterlms-helper/includes/models/class-llms-helper-add-on.php

	public function get_download_info() {

		$key = $this->find_license();

		if ( $this->requires_license() && ! $key ) {
			return new WP_Error( 'no_license', __( 'Unable to locate a license key for the selected add-on.', 'lifterlms' ) );
		}

		$args = array(
			'url'         => get_site_url(),
			'add_on_slug' => $this->get( 'slug' ),
			'channel'     => $this->get_channel_subscription(),
		);

		if ( $key ) {
			$args['license_key'] = $key['license_key'];
			$args['update_key']  = $key['update_key'];
		}

		$req = new LLMS_Dot_Com_API(
			'/license/download',
			$args
		);

		$data = $req->get_result();

		if ( $req->is_error() ) {
			return $data;
		}

		return $data;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.4.0 Use core textdomain.
3.2.1 Allow getting download info for add-ons which do not require licenses.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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