Admin.php
3 weeks ago
AdminAbout.php
3 weeks ago
AdminAssets.php
3 weeks ago
AdminConvert.php
3 weeks ago
AdminCore.php
3 weeks ago
AdminDashboard.php
3 weeks ago
AdminIntegration.php
3 weeks ago
AdminPages.php
3 weeks ago
AdminSettings.php
3 weeks ago
AdminTools.php
3 weeks ago
AdminCore.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPParsidate\Admin; |
| 4 | |
| 5 | defined( 'ABSPATH' ) || exit; |
| 6 | |
| 7 | class AdminCore { |
| 8 | public const tab = 'core'; |
| 9 | public const icon = '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M20.9423 3.05768C23.4117 5.52701 21.4099 11.5324 16.4712 16.4711C11.5326 21.4097 5.5272 23.4115 3.05787 20.9422C0.588547 18.4728 2.59033 12.4675 7.52899 7.5288C12.4676 2.59014 18.473 0.588345 20.9423 3.05768ZM3.05768 3.05782C0.588349 5.52715 2.59013 11.5325 7.52879 16.4712C12.4674 21.4099 18.4728 23.4117 20.9421 20.9423C23.4115 18.473 21.4097 12.4676 16.471 7.52894C11.5324 2.59028 5.527 0.588485 3.05768 3.05782Z" stroke="#3c3c3c" stroke-width="1.5"></path> <path d="M14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5C13.3807 9.5 14.5 10.6193 14.5 12Z" stroke="#3c3c3c" stroke-width="1.5"></path> </g></svg>'; |
| 10 | |
| 11 | private static ?array $settings = null; |
| 12 | |
| 13 | public function __construct() { |
| 14 | add_filter( 'wp_parsidate_menus', [ $this, 'addMenu' ] ); |
| 15 | add_filter( 'wp_parsidate_' . self::tab . '_settings', [ $this, 'settings' ] ); |
| 16 | add_filter( 'wp_parsidate_settings', [ $this, 'allSettings' ] ); |
| 17 | } |
| 18 | |
| 19 | public function addMenu( $menus ) { |
| 20 | $menus[ self::tab ] = array( |
| 21 | 'title' => esc_html__( 'Core', 'wp-parsidate' ), |
| 22 | 'icon' => self::icon |
| 23 | ); |
| 24 | |
| 25 | return $menus; |
| 26 | } |
| 27 | |
| 28 | public function allSettings( $settings ): array { |
| 29 | $settings[ self::tab ] = $this->settings(); |
| 30 | |
| 31 | return $settings; |
| 32 | } |
| 33 | |
| 34 | public function settings(): array { |
| 35 | if ( self::$settings === null ) { |
| 36 | self::$settings = array( |
| 37 | 'title' => esc_html__( 'Core settings', 'wp-parsidate' ), |
| 38 | 'desc' => esc_html__( 'Global plugin settings', 'wp-parsidate' ), |
| 39 | 'sections' => apply_filters( 'wp_parsidate_' . self::tab . '_settings_sections', [] ) |
| 40 | //'settings' => apply_filters( 'wp_parsidate_' . self::tab . '_settings_options', [] ) |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | return self::$settings; |
| 45 | } |
| 46 | } |
| 47 |