Astra_Ext_White_Label_Markup::updates_core_page()

Update strings on the update-core.php page.


Description


Return

(void)


Source

File: classes/class-astra-ext-white-label-markup.php

		public function updates_core_page() {
			global $pagenow;

			if ( 'update-core.php' == $pagenow ) {
				$default_screenshot = sprintf( '%s/astra/screenshot.jpg', get_theme_root_uri() );
				$branded_screenshot = self::get_whitelabel_string( 'astra', 'screenshot', false );

				$default_name = 'Astra';
				$branded_name = self::get_whitelabel_string( 'astra', 'name', false );

				if ( false !== $branded_screenshot ) {
					wp_add_inline_script(
						'updates',
						"
						var _ast_default_ss = '$default_screenshot', _ast_branded_ss = '$branded_screenshot';

						document.querySelectorAll( '#update-themes-table .plugin-title .updates-table-screenshot' ).forEach(function(theme) {
							if( _ast_default_ss === theme.src ) {
								theme.src = _ast_branded_ss;
							}
						});"
					);
				}

				if ( false !== $branded_name ) {
					wp_add_inline_script(
						'updates',
						"
						var _ast_default_name = '$default_name', _ast_branded_name = '" . esc_js( $branded_name ) . "';

						document.querySelectorAll( '#update-themes-table .plugin-title strong' )
						.forEach(function(plugin) {
							if( _ast_default_name === plugin.innerText ) {
								plugin.innerText = _ast_branded_name;
							}
						});"
					);
				}
			}
		}

Changelog

Changelog
Version Description
1.6.14 Introduced.


User Contributed Notes

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