connect = new Connect();
}
/**
* Actually adds the menu items to the admin bar.
*
* @since 4.0.0
*
* @return void
*/
protected function addAdminBarMenuItems() {
// Add an upsell to Pro.
if ( current_user_can( $this->getPageRequiredCapability( '' ) ) ) {
$this->adminBarMenuItems['aioseo-pro-upgrade'] = [
'parent' => 'aioseo-main',
'title' => '',
'id' => 'aioseo-pro-upgrade',
'href' => apply_filters( 'aioseo_upgrade_link', aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'lite-upgrade/', 'admin-bar', null, false ) ),
'meta' => [ 'target' => '_blank' ],
];
}
parent::addAdminBarMenuItems();
}
/**
* Add the menu inside of WordPress.
*
* @since 4.0.0
*
* @return void
*/
public function addMenu() {
parent::addMenu();
$capability = $this->getPageRequiredCapability( '' );
// We use the global submenu, because we are adding an external link here.
if ( current_user_can( $capability ) ) {
global $submenu;
$submenu[ $this->pageSlug ][] = [
'',
$capability,
apply_filters( 'aioseo_upgrade_link', aioseo()->helpers->utmUrl( AIOSEO_MARKETING_URL . 'lite-upgrade/', 'admin-menu', null, false ) )
];
}
}
}