license->get_network_license_key(); $license_key = $license_key ? $license_key : MonsterInsights()->license->get_default_license_key(); $license_type = MonsterInsights()->license->get_network_license_type(); ?> auth->get_network_viewname() ) { $network_ua = MonsterInsights()->auth->get_network_manual_ua(); ?> >
license->get_network_license_key() ) { ?>

license->network_license_has_error() ) { ?> license->get_network_license_error() ); ?>
' . $license_type . '' ); ?>

auth->get_network_viewname() && MonsterInsights()->auth->get_network_ua() ) { ?>
auth->get_network_viewname() && MonsterInsights()->auth->get_network_ua() ) { ?> license->is_network_licensed() ) { ?>

auth->get_network_viewname(); ?>

license->is_network_licensed() ) { ?>

', '' ); ?>

auth->get_network_manual_ua(); if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old === $manual_ua_code ) { // Same code we had before // Do nothing } else if ( $manual_ua_code && $manual_ua_code_old && $manual_ua_code_old !== $manual_ua_code ) { // Different UA code MonsterInsights()->auth->set_network_manual_ua( $manual_ua_code ); } else if ( $manual_ua_code && empty( $manual_ua_code_old ) ) { // Move to manual MonsterInsights()->auth->set_network_manual_ua( $manual_ua_code ); } else if ( empty( $manual_ua_code ) && $manual_ua_code_old ) { // Deleted manual MonsterInsights()->auth->delete_network_manual_ua(); } else if ( isset( $_POST['network_manual_ua_code'] ) && empty( $manual_ua_code ) ) { $throw_notice = true; } else { // Not UA before or after // Do nothing } $network_hide_am_notices = isset( $_POST['network_hide_am_notices'] ) ? 1 : 0; $network_hide_am_notices_old = monsterinsights_get_option( 'network_hide_am_notices', false ); if ( $network_hide_am_notices != $network_hide_am_notices_old ) { monsterinsights_update_option( 'network_hide_am_notices', $network_hide_am_notices ); $throw_notice = true; } // Output an admin notice so the user knows what happened if ( $throw_notice ) { add_action( 'monsterinsights_network_settings_general_tab_notice', 'monsterinsights_invalid_ua_code' ); } else { add_action( 'monsterinsights_network_settings_general_tab_notice', 'monsterinsights_updated_settings' ); } } add_action( 'admin_init', 'monsterinsights_network_settings_save_general', 11 );