Skip to content

Commit

Permalink
fix: Remove theme color from manually input posts
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanfredrik committed Jul 12, 2023
1 parent 5059171 commit a763e58
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions autoload/colors.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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;
// });

0 comments on commit a763e58

Please sign in to comment.