This commit is contained in:
2026-04-26 23:47:49 +02:00
parent 1b95f03d1e
commit b073e009d8
5288 changed files with 1112699 additions and 55536 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace Smashballoon\Customizer\Tabs;
use Smashballoon\Stubs\Traits\Singleton;
/** @internal */
class Manager
{
use Singleton;
/**
* @var Tab[]
*/
private $tabs = [];
/**
* @param Tab $tab
*
* @return void
*/
public function register_tab(\Smashballoon\Customizer\Tabs\Tab $tab)
{
$this->tabs[] = $tab;
}
/**
* @return array
*/
public function get_tabs()
{
$tabs = [];
foreach ($this->tabs as $tab) {
$section_id = $tab->get_id();
$tabs[$section_id] = ['id' => $section_id, 'heading' => $tab->get_heading(), 'sections' => $tab->get_sections()];
}
return $tabs;
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace Smashballoon\Customizer\Tabs;
/** @internal */
abstract class Tab
{
protected $id;
protected $heading;
public function get_sections()
{
return [];
}
public function get_id()
{
return $this->id;
}
public function get_heading()
{
return $this->heading;
}
}