forked from awesomemotive/all-in-one-seo-pack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeb20ec
commit 483ae95
Showing
434 changed files
with
24,128 additions
and
18,795 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
namespace AIOSEO\Plugin\Common\Admin; | ||
|
||
// Exit if accessed directly. | ||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Abstract class that Pro and Lite both extend. | ||
* | ||
* @since 4.2.5 | ||
*/ | ||
class NetworkAdmin extends Admin { | ||
/** | ||
* Construct method. | ||
* | ||
* @since 4.2.5 | ||
*/ | ||
public function __construct() { | ||
include_once ABSPATH . 'wp-admin/includes/plugin.php'; | ||
if ( | ||
is_network_admin() && | ||
! is_plugin_active_for_network( plugin_basename( AIOSEO_FILE ) ) | ||
) { | ||
return; | ||
} | ||
|
||
if ( wp_doing_ajax() || wp_doing_cron() ) { | ||
return; | ||
} | ||
|
||
add_action( 'sanitize_comment_cookies', [ $this, 'init' ], 21 ); | ||
} | ||
|
||
/** | ||
* Initialize the admin. | ||
* | ||
* @since 4.2.5 | ||
* | ||
* @return void | ||
*/ | ||
public function init() { | ||
add_action( 'network_admin_menu', [ $this, 'addNetworkMenu' ] ); | ||
|
||
$this->setPages(); | ||
} | ||
|
||
/** | ||
* Add the network menu inside of WordPress. | ||
* | ||
* @since 4.2.5 | ||
* | ||
* @return void | ||
*/ | ||
public function addNetworkMenu() { | ||
$this->addMainMenu( 'aioseo' ); | ||
|
||
foreach ( $this->pages as $slug => $page ) { | ||
if ( | ||
'aioseo-settings' !== $slug && | ||
'aioseo-tools' !== $slug && | ||
'aioseo-about' !== $slug && | ||
'aioseo-feature-manager' !== $slug | ||
) { | ||
continue; | ||
} | ||
|
||
$hook = add_submenu_page( | ||
$this->pageSlug, | ||
! empty( $page['page_title'] ) ? $page['page_title'] : $page['menu_title'], | ||
$page['menu_title'], | ||
$this->getPageRequiredCapability( $slug ), | ||
$slug, | ||
[ $this, 'page' ] | ||
); | ||
add_action( "load-{$hook}", [ $this, 'hooks' ] ); | ||
} | ||
|
||
// Remove the "dashboard" submenu page that is not needed in the network admin. | ||
remove_submenu_page( $this->pageSlug, $this->pageSlug ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.