Skip to content

Commit

Permalink
If multisite move admin page to network admin
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumemolter committed Aug 6, 2016
1 parent 7c3dc8b commit 9dfe2f3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion postmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
}
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 9dfe2f3

Please sign in to comment.