BSF_Update_Manager::modify_download_package_message( string $reply, string $package, string $current )

Modify download package message to hide download URL.


Description


Parameters

$reply

(string) (Required) Reply.

$package

(string) (Required) Package.

$current

(string) (Required) Current.


Return

(string) $reply.


Source

File: admin/bsf-core/class-bsf-update-manager.php

		public function modify_download_package_message( $reply, $package, $current ) {

			// Read atts into separate veriables so that easy to reference below.
			$strings = $current->strings;

			if ( isset( $current->skin->plugin_info ) ) {
				$plugin_info = $current->skin->plugin_info;

				if ( ( isset( $plugin_info['author'] ) && 'Brainstorm Force' === $plugin_info['author'] ) || ( isset( $plugin_info['AuthorName'] ) && 'Brainstorm Force' === $plugin_info['AuthorName'] ) ) {
					$strings['downloading_package'] = __( 'Downloading the update...', 'bsf-core' );
				}
			} elseif ( isset( $current->skin->theme_info ) ) {

				$theme_info   = $current->skin->theme_info;
				$theme_author = $theme_info->get( 'Author' );

				if ( 'Brainstorm Force' === $theme_author ) {
					$strings['downloading_package'] = __( 'Downloading the update...', 'bsf-core' );
				}
			} elseif ( isset( $_GET['action'] ) && 'bsf_rollback' === $_GET['action'] && check_admin_referer( 'bsf_rollback' ) ) {
				// In case of rollback version.
				$strings['downloading_package'] = __( 'Downloading the update...', 'bsf-core' );
			}

			// restore the strings back to WP_Upgrader.
			$current->strings = $strings;

			// We are not changing teh return parameter.
			return $reply;
		}

User Contributed Notes

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