Viewing 2 reply threads
  • Author
    Posts
    • #6442
      mariusnicula
      Member

      Hello,

      I’ve created a custom settings page to use just like an Options Page from ACF and it works great, except for the add_more field. See attached images before and after saving.

      Thanks for Piklist and your support.

      Attachments:
      You must be logged in to view attached files.
    • #6445
      mariusnicula
      Member

      Here is the code for that section:

      <?php
      /*
      Title: Footer Section
      Setting: piklist_settings
      */

      piklist(‘field’, array(
      ‘type’ => ‘group’,
      ‘scope’ => ‘post_meta’,
      ‘field’ => ‘footer_options’,
      ‘fields’ => array(

      array(
      ‘type’ => ‘file’,
      ‘field’ => ‘option_image’,
      ‘scope’ => ‘post_meta’,
      ‘label’ => ‘Option Image’,
      ‘options’ => array(
      ‘modal_title’ => ‘Add Image’,
      ‘button’ => ‘Add’
      ),
      ‘validate’ => array(
      array(
      ‘type’ => ‘limit’,
      ‘options’ => array(
      ‘min’ => 1,
      ‘max’ => 1
      )
      )
      ),
      ‘columns’ => 12
      ),

      array(
      ‘type’ => ‘text’,
      ‘scope’ => ‘post_meta’,
      ‘field’ => ‘option_link’,
      ‘label’ => ‘Option Link’,
      ‘position’ => ‘wrap’,
      ‘columns’ => 6
      ),

      ),
      ‘label’ => ‘Footer Networks’,
      ‘position’ => ‘wrap’,
      ‘add_more’ => true,
      ‘columns’ => 12
      ));

      ?>

    • #6447
      Steve
      Keymaster

      @mariusnicula– There are two issues here:

      1) You are using the setting piklist_settings. You probably want to register your own setting.
      2) The scope is being set to post_meta, which is telling Piklist to save your data to a post… but since this is a settings page, nothing is being saved. So remove all references to scope.

      This tutorial should help.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.