diff --git a/CHANGES.md b/CHANGES.md index 232210584..ed74c6456 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Changelog +## 2.31.3 (1/8/24) +* Fixed: Added back updater icon functions. + ## 2.31.2 (1/8/24) * Changed: Now Load core getter functions immediately instead of `after_setup_theme`. * Fixed: Cover block overlay was not rendering correctly when using Link as the overlay color. diff --git a/lib/init.php b/lib/init.php index 46fb45b24..67430dfea 100644 --- a/lib/init.php +++ b/lib/init.php @@ -851,6 +851,61 @@ function mai_get_full_config() { return $config; } +/** + * Gets the plugin updater icons. + * This may be used in additiona Mai Plugins. + * + * @since 2.11.0 + * + * @return array + */ +function mai_get_updater_icons() { + $icons = []; + $standard = mai_get_logo_icon_1x(); + $retina = mai_get_logo_icon_2x(); + if ( $standard && $retina ) { + $icons = [ + '1x' => $standard, + '2x' => $retina, + ]; + } + return $icons; +} + +/** + * Gets the Mai Theme logo icon @1x for plugin updater. + * + * @since 2.11.0 + * + * @return string + */ +function mai_get_logo_icon_1x() { + static $icon = null; + if ( ! is_null( $icon ) ) { + return $icon; + } + $file = 'assets/img/icon-128x128.png'; + $icon = file_exists( mai_get_dir() . $file ) ? mai_get_url() . $file : ''; + return $icon; +} + +/** + * Gets the Mai Theme logo icon @1x for plugin updater. + * + * @since 2.11.0 + * + * @return string + */ +function mai_get_logo_icon_2x() { + static $icon = null; + if ( ! is_null( $icon ) ) { + return $icon; + } + $file = 'assets/img/icon-256x256.png'; + $icon = file_exists( mai_get_dir() . $file ) ? mai_get_url() . $file : ''; + return $icon; +} + /** * Checks if Mai needs to load ACF Pro. * diff --git a/mai-engine.php b/mai-engine.php index f1f71f281..f7c3ca17a 100644 --- a/mai-engine.php +++ b/mai-engine.php @@ -6,7 +6,7 @@ * Plugin URI: https://bizbudding.com/mai-theme/ * GitHub Plugin URI: https://github.com/maithemewp/mai-engine/ * Description: The required plugin to power Mai child themes. - * Version: 2.31.2 + * Version: 2.31.3 * Requires at least: 6.4 * Requires PHP: 7.4 * Author: BizBudding