Skip to content

Commit 43d69ad

Browse files
committed
Merge branch 'main' into FAU-448
2 parents fe10743 + 97b104c commit 43d69ad

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/Infrastructure/Content/Taxonomy/Taxonomy.php

+14
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ final public static function hidden(): static
4848
);
4949
}
5050

51+
final public static function editableOnly(): static
52+
{
53+
return self::default()->merge(
54+
[
55+
'public' => false,
56+
'show_ui' => true,
57+
'show_in_menu' => true,
58+
'show_in_nav_menus' => false,
59+
'show_in_rest' => true,
60+
'meta_box_cb' => false,
61+
]
62+
);
63+
}
64+
5165
final public function args(): array
5266
{
5367
return $this->args;

tests/unit/Content/TaxonomyTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ public function testTaxonomyArgGeneration(): void
5050
DegreeTaxonomy::public()->args()
5151
);
5252

53+
$this->assertSame(
54+
[
55+
'label' => 'Degrees',
56+
'labels' => $expectedLabels,
57+
'hierarchical' => true,
58+
'rest_base' => 'degree',
59+
'public' => false,
60+
'show_ui' => true,
61+
'show_in_menu' => true,
62+
'show_in_nav_menus' => false,
63+
'show_in_rest' => true,
64+
'meta_box_cb' => false,
65+
],
66+
DegreeTaxonomy::editableOnly()->args()
67+
);
68+
5369
$this->assertSame(
5470
[
5571
'label' => 'Degrees',

0 commit comments

Comments
 (0)