| @@ -1,18 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * FrontendController.php | |
| 4 | - * | |
| 5 | - * The FrontendController class file. | |
| 6 | - * | |
| 7 | - * PHP versions 5 | |
| 8 | - * | |
| 9 | - * @author Alexander Schneider <alexanderschneider85@gmail.com> | |
| 10 | - * @copyright 2008-2017 Alexander Schneider | |
| 11 | - * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 | |
| 12 | - * @version SVN: $id$ | |
| 13 | - * @link http://wordpress.org/extend/plugins/user-access-manager/ | |
| 14 | - */ | |
| 15 | 2 | |
| 16 | 3 | declare(strict_types=1); |
| 17 | 4 | |
| 18 | 5 | namespace UserAccessManager\Controller\Frontend; |
| @@ -25,13 +12,8 @@ | ||
| 25 | 12 | use UserAccessManager\UserGroup\UserGroupTypeException; |
| 26 | 13 | use UserAccessManager\Wrapper\Php; |
| 27 | 14 | use UserAccessManager\Wrapper\Wordpress; |
| 28 | 15 | |
| 29 | -/** | |
| 30 | - * Class FrontendController | |
| 31 | - * | |
| 32 | - * @package UserAccessManager\Controller | |
| 33 | - */ | |
| 34 | 16 | class FrontendController extends Controller |
| 35 | 17 | { |
| 36 | 18 | public const HANDLE_STYLE_LOGIN_FORM = 'UserAccessManagerLoginForm'; |
| 37 | 19 | |
| @@ -44,24 +26,17 @@ | ||
| 44 | 26 | ) { |
| 45 | 27 | parent::__construct($php, $wordpress, $wordpressConfig); |
| 46 | 28 | } |
| 47 | 29 | |
| 48 | - private function registerStylesAndScripts(): void | |
| 30 | + public function enqueueStylesAndScripts(): void | |
| 49 | 31 | { |
| 50 | - $urlPath = $this->wordpressConfig->getUrlPath(); | |
| 51 | - | |
| 52 | 32 | $this->wordpress->registerStyle( |
| 53 | 33 | self::HANDLE_STYLE_LOGIN_FORM, |
| 54 | - $urlPath.'assets/css/uamLoginForm.css', | |
| 34 | + $this->wordpressConfig->getUrlPath().'assets/css/uamLoginForm.css', | |
| 55 | 35 | [], |
| 56 | 36 | UserAccessManager::VERSION, |
| 57 | 37 | 'screen' |
| 58 | 38 | ); |
| 59 | - } | |
| 60 | - | |
| 61 | - public function enqueueStylesAndScripts(): void | |
| 62 | - { | |
| 63 | - $this->registerStylesAndScripts(); | |
| 64 | 39 | $this->wordpress->enqueueStyle(self::HANDLE_STYLE_LOGIN_FORM); |
| 65 | 40 | } |
| 66 | 41 | |
| 67 | 42 | /** |
| @@ -83,13 +58,8 @@ | ||
| 83 | 58 | |
| 84 | 59 | return $ancestors; |
| 85 | 60 | } |
| 86 | 61 | |
| 87 | - | |
| 88 | - /* | |
| 89 | - * Functions for the redirection and files. | |
| 90 | - */ | |
| 91 | - | |
| 92 | 62 | /** |
| 93 | 63 | * @throws UserGroupTypeException |
| 94 | 64 | */ |
| 95 | 65 | public function getWpSeoUrl(array|string $url, string $type, object $object): bool|array|string |
| @@ -96,16 +66,12 @@ | ||
| 96 | 66 | { |
| 97 | 67 | return ($this->accessHandler->checkObjectAccess($type, $object->ID) === true) ? $url : false; |
| 98 | 68 | } |
| 99 | 69 | |
| 100 | - /* | |
| 101 | - * Elementor | |
| 102 | - */ | |
| 103 | - | |
| 104 | 70 | /** |
| 105 | 71 | * @throws UserGroupTypeException |
| 106 | 72 | */ |
| 107 | - public function getElementorContent($content): mixed | |
| 73 | + public function getElementorContent(mixed $content): mixed | |
| 108 | 74 | { |
| 109 | 75 | $this->wordpress->removeAction('elementor/frontend/the_content', [$this, 'getElementorContent']); |
| 110 | 76 | $post = $this->wordpress->getCurrentPost(); |
| 111 | 77 | |