Viewing 3 reply threads
  • Author
    Posts
    • #1962
      tuckerjoenz
      Member

      I’m trying to create an admin menu page with multiple tabs each with forms. I have followed the tutorials on adding tabs to a sub-menu page and that worked but I can’t seem to figure out how to get it to work for my page. Here is my function.php code:

      add_filter('piklist_admin_pages', 'client_forms_admin_pages');
      function client_forms_admin_pages($pages) {
           $pages[] = array(
            'page_title' => __('Client Forms', 'piklist')
            ,'menu_title' => __('Client Forms', 'piklist')
            ,'capability' => 'manage_options'
            ,'menu_slug' => 'client-forms'
            ,'setting' => 'custom_settings'
            ,'menu_icon' => 'dashicons-welcome-write-blog'
            ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png')
            ,'default_tab' => 'General'
            ,'single_line' => true
            ,'save_text' => 'Save Forms'
          );
      
          return $pages;
        }

      And I have a piklist/parts/workflow/header.php:

      <?php
      /*
      Flow: Client Forms
      Page: admin.php
      Post Type: client_forms
      Header: true
      Position: title
      */
      ?>

      And also a piklist/parts/workflow/tab.php:

      <?php
      /*
      Title: List of Participants
      Order: 10
      Flow: Client Forms
      */
      
      piklist('include_meta_boxes', array(
          'piklist_meta_help'
          ,'piklist_meta_field_text'
          ,'piklist_meta_field_select'
          ,'piklist_meta_field_radio'
          ,'piklist_meta_field_checkbox'
          ,'piklist_meta_field_upload'
          ,'piklist_meta_field_taxonomies'
          ,'piklist_meta_field_featured_image'
          ,'piklist_meta_field_relate'
          ,'piklist_meta_field_comments'
        ));
      
      piklist('field', array(
          'type' => 'group'
          ,'field' => 'workout_schedule'
          ,'label' => __('Tasks')
          ,'columns' => 12
          ,'add_more' => true
          ,'fields' => array(
            array(
              'type' => 'select'
              ,'field' => 'day'
              ,'columns' => 12
              ,'choices' => array(
                'monday' => 'Monday'
                ,'tuesday' => 'Tuesday'
                ,'wednesday' => 'Wednesday'
                ,'thursday' => 'Thursday'
                ,'friday' => 'Friday'
                ,'saturday' => 'Saturday'
                ,'sunday' => 'Sunday'
              )
            )
            ,array(
              'type' => 'group'
              ,'field' => 'excercise_day'
              ,'add_more' => true
              ,'fields' => array(
                array(
                  'type' => 'text'
                  ,'field' => 'excercise'
                  ,'columns' => 8
                  ,'attributes' => array(
                    'placeholder' => 'Exercise'
                  )
                )
                ,array(
                  'type' => 'text'
                  ,'field' => 'excercise_reps'
                  ,'columns' => 2
                  ,'attributes' => array(
                    'placeholder' => 'Reps'
                  )
                )
                ,array(
                  'type' => 'text'
                  ,'field' => 'excercise_sets'
                  ,'columns' => 2
                  ,'attributes' => array(
                    'placeholder' => 'Sets'
                  )
                )
              )
            )
          )
        ));
      ?>
    • #1964
      Steve
      Keymaster

      Settings Tabs are handled differently than Workflow Tabs. Tutorial is here >

    • #1965
      tuckerjoenz
      Member

      Thanks Steve for the direction. Great stuff here. I’m new to wordpress but LOVE this plugin.

    • #1974
      Steve
      Keymaster

      Glad to hear it! Let us know if you need anymore help.

Viewing 3 reply threads
  • The topic ‘Having issues creating a admin page with workflow tabs for forms’ is closed to new replies.