Skip to content

Commit

Permalink
Fixing the helper function to work with the latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea-tcg committed Mar 30, 2020
1 parent bf81e20 commit 809d3e6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,16 @@ function theme_field($type, $key, $title, $content = '', $details = '', $placeho
$content = $option_exists->value;
}

$row = (object)['required' => $required, 'field' => $key, 'type' => $type, 'details' => $details, 'display_name' => $placeholder];
$dataTypeContent = (object)[$key => $content];
$row = new class{ public function getTranslatedAttribute(){} };
$row->required = $required;
$row->field = $key;
$row->type = $type;
$row->details = $details;
$row->display_name = $placeholder;

$dataTypeContent = new class{ public function getKey(){} };
$dataTypeContent->{$key} = $content;

$label = '<label for="'. $key . '">' . $title . '<span class="how_to">You can reference this value with <code>theme(\'' . $key . '\')</code></span></label>';
$details = '<input type="hidden" value="' . $details . '" name="' . $key . '_details__theme_field">';
$type = '<input type="hidden" value="' . $type . '" name="' . $key . '_type__theme_field">';
Expand Down

0 comments on commit 809d3e6

Please sign in to comment.