diff --git a/postmark.php b/postmark.php index a1352c8..f97e570 100644 --- a/postmark.php +++ b/postmark.php @@ -24,7 +24,14 @@ function __construct() { function init() { - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + + if( is_multisite() ) { + add_action( 'network_admin_menu', array( $this, 'network_admin_menu' ) ); + } + else { + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + } + add_action( 'wp_ajax_postmark_save', array( $this, 'save_settings' ) ); add_action( 'wp_ajax_postmark_test', array( $this, 'send_test_email' ) ); } @@ -54,6 +61,10 @@ function load_settings() { function admin_menu() { add_options_page( 'Postmark', 'Postmark', 'manage_options', 'pm_admin', array( $this, 'settings_html' ) ); } + + function network_admin_menu() { + add_options_page( 'Postmark', 'Postmark', 'manage_network_options', 'pm_admin', array( $this, 'settings_html' ) ); + } function send_test_email() {