From a763e5872aed01b3a8a89830ffdb1326333e81dc Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Wed, 12 Jul 2023 22:18:02 +0200 Subject: [PATCH] fix: Remove theme color from manually input posts --- autoload/colors.php | 56 ++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/autoload/colors.php b/autoload/colors.php index b2c6a4d..8112456 100644 --- a/autoload/colors.php +++ b/autoload/colors.php @@ -81,30 +81,30 @@ function ($type_registry) { 20 ); -// function municipio_gatsby_get_theme_field($extra = []) { -// $options = [ -// // ["" => __("None", "municipio-gatsby")], -// ]; -// $options = apply_filters("municipio-gatsby/color-choices", $options, $extra); -// $field_theme_color_options = [ -// "key" => "field_5fae89a2efe55", -// "label" => __("Theme color", "municipio-gatsby"), -// "name" => "theme", -// "type" => count($options) > 8 ? "select" : "radio", -// // "parent" => "", // Intentionally left out -// "instructions" => "", -// "show_in_graphql" => true, -// "graphql_field_name" => "theme", -// "choices" => $options, -// "default_value" => "", -// "allow_null" => false, -// "other_choice" => false, -// "save_other_choice" => false, -// "layout" => "horizontal", -// "return_format" => "value", -// ]; -// return array_merge($field_theme_color_options, $extra); -// } +function municipio_gatsby_get_theme_field($extra = []) { + $options = [ + // ["" => __("None", "municipio-gatsby")], + ]; + $options = apply_filters("municipio-gatsby/color-choices", $options, $extra); + $field_theme_color_options = [ + "key" => "field_5fae89a2efe55", + "label" => __("Theme color", "municipio-gatsby"), + "name" => "theme", + "type" => count($options) > 8 ? "select" : "radio", + // "parent" => "", // Intentionally left out + "instructions" => "", + "show_in_graphql" => true, + "graphql_field_name" => "theme", + "choices" => $options, + "default_value" => "", + "allow_null" => false, + "other_choice" => false, + "save_other_choice" => false, + "layout" => "horizontal", + "return_format" => "value", + ]; + return array_merge($field_theme_color_options, $extra); +} // Theme color add_action( @@ -145,7 +145,7 @@ function () { ); // Data input -add_filter("acf/load_field/key=field_576258d3110b0", function ($field) { - $field["sub_fields"][] = municipio_gatsby_get_theme_field(); - return $field; -}); +// add_filter("acf/load_field/key=field_576258d3110b0", function ($field) { +// $field["sub_fields"][] = municipio_gatsby_get_theme_field(); +// return $field; +// });