Skip to content

Commit

Permalink
feat!: Remove landing page template and add `whitespace_a11ystack_pag…
Browse files Browse the repository at this point in the history
…e_templates` filter
  • Loading branch information
jeanfredrik committed Sep 1, 2023
1 parent e5fc409 commit 62b7842
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions autoload/page-appearance.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ function ($page_templates) use ($post_type_slug) {

// Adds "Page appearance" field group on pages
add_action("acf/init", function () {
$page_templates = [
"default" => __("Default", "municipio-gatsby"),
// "landingPage" => __("Landing page", "municipio-gatsby"),
];
$page_templates = apply_filters(
"whitespace_a11ystack_page_templates",
$page_templates
);
acf_add_local_field_group([
"key" => "group_page_appearance",
"title" => __("Page appearance", "municipio-gatsby"),
Expand All @@ -31,12 +39,14 @@ function ($page_templates) use ($post_type_slug) {
"name" => "template",
"type" => "select",
"default_value" => "default",
"choices" => [
"default" => __("Default", "municipio-gatsby"),
"landingPage" => __("Landing page", "municipio-gatsby"),
],
"choices" => $page_templates,
"return_format" => "value",
"show_in_graphql" => 1,
// Hide the field if there is only one choice
"wrapper" => [
// Hide the field if there is only one choice
"style" => count($page_templates) > 1 ? null : "display:none;",
],
],
],
"location" => [
Expand Down

0 comments on commit 62b7842

Please sign in to comment.