Skip to content

Commit

Permalink
Fix fatal error on Options page
Browse files Browse the repository at this point in the history
  • Loading branch information
serena-piccioni committed Nov 15, 2024
1 parent 49c0eec commit f45b7d8
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 88 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public function register()

public function addPageTemplatesFields()
{
if (!function_exists('acf_add_local_field_group')) {
return;
}

acf_add_local_field_group([
'key' => 'group_59427d8ae4e29',
'title' => 'Page introduction',
Expand Down
180 changes: 92 additions & 88 deletions wp-content/themes/dxw-security-2017/app/Theme/OptionsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,103 +6,107 @@ class OptionsPage implements \Dxw\Iguana\Registerable
{
public function register()
{
acf_add_options_sub_page('Banner');
if (function_exists('acf_add_options_sub_page')) {
acf_add_options_sub_page('Banner');
}

// Hire us banner
acf_add_local_field_group([
'key' => 'group_5857b450d2170',
'title' => 'Call to action banner',
'fields' => [
[
'key' => 'field_5857b463ac3e9',
'label' => 'Header',
'name' => 'header',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
if (function_exists('acf_add_local_field_group')) {
acf_add_local_field_group([
'key' => 'group_5857b450d2170',
'title' => 'Call to action banner',
'fields' => [
[
'key' => 'field_5857b463ac3e9',
'label' => 'Header',
'name' => 'header',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
[
'key' => 'field_5857b46dac3ea',
'label' => 'Content',
'name' => 'content',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
[
'key' => 'field_5857b46dac3ea',
'label' => 'Content',
'name' => 'content',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'basic',
'media_upload' => 0,
],
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'basic',
'media_upload' => 0,
],
[
'key' => 'field_5857b47dac3eb',
'label' => 'URL',
'name' => 'url',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
[
'key' => 'field_5857b47dac3eb',
'label' => 'URL',
'name' => 'url',
'type' => 'url',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
],
'default_value' => '',
'placeholder' => '',
],
[
'key' => 'field_5857b491ac3ec',
'label' => 'Call to action',
'name' => 'cta',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
[
'key' => 'field_5857b491ac3ec',
'label' => 'Call to action',
'name' => 'cta',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => [
'width' => '',
'class' => '',
'id' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
],
],
'location' => [
[
'location' => [
[
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options-banner',
[
'param' => 'options_page',
'operator' => '==',
'value' => 'acf-options-banner',
],
],
],
],
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
]);
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => 1,
'description' => '',
]);
}
}
}

0 comments on commit f45b7d8

Please sign in to comment.