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_Helper_Upgrader::get_changelog_html( string $tag, string $url )

Retrieve changelog information from the make blog


Description Description

Retrieves the most recent 10 changelog entries for the add-on, formats the returned information into a format suitable to display within the thickbox, adds a link to the full changelog, and returns the html string.

If an error is encountered, returns an empty string.


Top ↑

Parameters Parameters

$tag

(string) (Required) Tag slug for the add-on on the blog.

$url

(string) (Required) Full URL to the changelog entries for the add-on.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: libraries/lifterlms-helper/includes/class-llms-helper-upgrader.php

		$tag   = end( $split );

		$logs = false;
		if ( ! empty( $tag ) && false === strpos( $tag, '.html' ) ) {
			$logs = $this->get_changelog_html( $tag, $src );
		}

		// Translators: %s = URL for the changelog website.
		return $logs ? $logs : make_clickable( sprintf( __( 'There was an error retrieving the changelog.<br>Try visiting %s for recent changelogs.', 'lifterlms' ), 'https://make.lifterlms.com/category/release-notes/' ) );
	}

	/**
	 * Retrieve changelog information from the make blog
	 *
	 * Retrieves the most recent 10 changelog entries for the add-on, formats the returned information
	 * into a format suitable to display within the thickbox, adds a link to the full changelog,
	 * and returns the html string.
	 *
	 * If an error is encountered, returns an empty string.
	 *
	 * @since 3.1.0
	 * @since 3.2.0 Fix usage of incorrect textdomain.
	 *
	 * @param string $tag Tag slug for the add-on on the blog.
	 * @param string $url Full URL to the changelog entries for the add-on.
	 * @return string
	 */
	private function get_changelog_html( $tag, $url ) {

		$ret  = '';
		$req  = wp_remote_get( add_query_arg( 'slug', $tag, 'https://make.lifterlms.com/wp-json/wp/v2/tags' ) );
		$body = json_decode( wp_remote_retrieve_body( $req ), true );


Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Fix usage of incorrect textdomain.
3.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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