Skip to content

Commit

Permalink
Merge pull request #14 from 2ndkauboy/fix/3-warn-if-not-on-multisite
Browse files Browse the repository at this point in the history
Warn if not on multisite
  • Loading branch information
webzunft authored Jan 24, 2024
2 parents 17d635f + 9a8ed01 commit 0181df1
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion individual-author.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,23 @@
define( 'IMADIR', basename( dirname( __FILE__ ) ) );
define( 'IMAPATH', plugin_dir_path( __FILE__ ) );

if ( ! is_multisite() ) {
add_action( 'admin_notices', 'ima_not_a_multisite' );

return;
}

/**
* Show an admin notice error message, if the `vendor` folder is missing.
*/
function ima_not_a_multisite() {
echo '<div class="error"><p>';
esc_html_e( 'Individual Multisite Author only works with a multisite installation.', 'individual-multisite-author' );
echo '</p></div>';
}

// load the plugin only on multisites
if ( ! class_exists( 'Ima_Class', false ) && is_multisite() ) {
if ( ! class_exists( 'Ima_Class', false ) ) {

class Ima_Class {

Expand Down

0 comments on commit 0181df1

Please sign in to comment.