heikkivihersalo / gutenberg-native-ai

GNU General Public License v2.0
0 stars 0 forks source link

Add warnings when plugin is missing dependencies #7

Closed heikkivihersalo closed 1 day ago

heikkivihersalo commented 1 week ago

Currently if dependencies are missing, plugin gives critical error. Adding admin notices and safe guards to prevent this behaviour is needed. It can be something like this.

add_action(
    'admin_notices', function () {
        ?>
        <div class="notice notice-error">
            <p>
                             <?php _e( 'Theme assets are missing. Run `yarn` and/or `yarn build` to generate them.', 'kotisivu-block-theme' );?>
                        </p>
        </div>
        <?php
    }
);