Skip to content

Commit

Permalink
network admin option page added
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Sergeev committed May 14, 2014
1 parent 28f1452 commit 786461e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions iframely/iframely.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function iframely_create_api_link () {

# Create iframely settings menu for admin
add_action( 'admin_menu', 'iframely_create_menu' );
add_action( 'network_admin_menu', 'iframely_network_admin_create_menu' );

# Create link to plugin options page from plugins list
function iframely_plugin_add_settings_link( $links ) {
Expand All @@ -124,12 +125,17 @@ function iframely_plugin_add_settings_link( $links ) {
$iframely_plugin_basename = plugin_basename( __FILE__ );
add_filter( 'plugin_action_links_' . $iframely_plugin_basename, 'iframely_plugin_add_settings_link' );

# Create new top level menu for sites
function iframely_create_menu() {
add_menu_page('Iframely Options', 'Iframely', 'install_plugins', 'iframely_settings_page', 'iframely_settings_page');
}

# Create new top-level menu
add_options_page('Iframely Options', 'Iframely', 'install_plugins', __FILE__, 'iframely_settings_page');
# Create new top level menu for network admin
function iframely_network_admin_create_menu() {
add_menu_page('Iframely Options', 'Iframely', 'manage_options', 'iframely_settings_page', 'iframely_settings_page');
}


function iframely_update_option($name, $value) {
return is_multisite() ? update_site_option($name, $value) : update_option($name, $value);
}
Expand Down

0 comments on commit 786461e

Please sign in to comment.