_moduleManager = $moduleManager; $this->_helper = $helper; } /** * @param Links $subject * @param Link[] $links * * @return mixed */ public function afterGetLinks( Links $subject, $links ) { if ($this->_moduleManager->isEnabled('Mageplaza_BlogPro') && $this->_helper->getPostViewPageConfig('enable_to_save')) { return $links; } else { $links = $this->unsetLinks($links); } return $links; } /** * @param $links * * @return mixed */ protected function unsetLinks($links) { if ($links && !$this->_helper->getConfigGeneral('customer_approve')) { foreach ($links as $key => $link) { if ($link->getPath() === 'mpblog/author/signup') { $this->_helper->setCustomerContextId(); $author = $this->_helper->getCurrentAuthor(); if ($author === null || !$author->getId()) { unset($links[$key]); } } } } return $links; } }