Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Demos: profile 'default' workflow tab missing info #3467
    vsalda
    Member

    I guess I’m getting closer, I modified the user-default.php to look like this:

    <?php
    /*
    Title: Default
    Order: 10
    Flow: User Test
    Default: true
    */
      
      piklist('include_user_profile_fields', array(
        'meta_boxes' => array(
          'User Info'
        )
      ));
    
      piklist('shared/code-locater', array(
        'location' => __FILE__
        ,'type' => 'Workflow Tab'
      ));
    
    ?>
    

    And added a file user-info.php to /parts/users containing:

    <?php
    /*
    Title: User Info
    Capability: manage_options
    Order: 10
    */
    
    $current_user = wp_get_current_user();
    $user_meta = get_user_meta($current_user->ID);
    
    piklist('field', array(
        'type' => 'hidden'
        ,'scope' => 'user'
        ,'field' => 'ID'
        ,'value' => $current_user->ID
    ));
    
    
    piklist('field', array(
        'type' => 'html'
        ,'scope' => 'user'
        ,'field' => 'user_login'
        ,'label' => 'User login'
        ,'value' => $current_user->user_login
    ));
    
    piklist('field', array(
        'type' => 'password'
        ,'scope' => 'user'
        ,'field' => 'user_pass'
        ,'label' => 'Password'
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user_meta'
        ,'field' => 'first_name'
        ,'label' => 'First name'
        ,'value' => $user_meta['first_name'][0]
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user_meta'
        ,'field' => 'last_name'
        ,'label' => 'Last name'
        ,'value' => $user_meta['last_name'][0]
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user_meta'
        ,'field' => 'nickname'
        ,'label' => 'Nickname'
        ,'value' => $user_meta['nickname'][0]
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user'
        ,'field' => 'display_name'
        ,'label' => 'Display name'
        ,'value' => $current_user->display_name
    ));
    
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user'
        ,'field' => 'user_email'
        ,'label' => 'Email'
        ,'value' => $current_user->user_email
        ,'required' => true
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user'
        ,'field' => 'user_url'
        ,'label' => 'Website'
        ,'value' => $current_user->user_url
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user_meta'
        ,'field' => 'user_twitter'
        ,'label' => 'Twitter ID'
        ,'value' => $user_meta['user_twitter'][0]
    ));
    
    piklist('field', array(
        'type' => 'text'
        ,'scope' => 'user_meta'
        ,'field' => 'description'
        ,'label' => 'Biographical Info'
        ,'value' => $user_meta['description'][0]
    ));
    
    
    piklist('field', array(
        'type' => 'checkbox'
        ,'scope' => 'user_meta'
        ,'field' => 'checkbox'
        ,'label' => 'Keyboard Shortcuts'
        ,'choices' => array(
            'true' => __('Enable keyboard shortcuts for comment moderation.', 'piklist-demo')
        )
    ));
    
    piklist('field', array(
        'type' => 'checkbox'
        ,'scope' => 'user_meta'
        ,'field' => 'checkbox'
        ,'label' => 'Toolbox'
        ,'choices' => array(
            'true' => __('Show Toolbar when viewing site', 'piklist-demo')
        )
    ));
    
    piklist('shared/code-locater', array(
        'location' => __FILE__
        ,'type' => 'Meta Box'
    ));
    

    I basically used the forms code. If I add info for First name and last name, those aren’t saved, but I works when I saved the Twitter ID. Any suggestion to get the user meta saved? Am I missing a paramater?

    Thanks in advance

    in reply to: Demos: profile 'default' workflow tab missing info #3465
    vsalda
    Member

    @Steve, it didn’t work. It’s a fresh install with only WordPress Importer and Piklist plugins active with Twentyfifteen theme and PHP 5.6.5. I will give it another try later. Thanks!

    in reply to: Demos: profile 'default' workflow tab missing info #3462
    vsalda
    Member

    Hi @Steve, yup, that’s the file I was checking before and the one that took me to class-piklist-user.php, but when debugging, these metaboxes aren’t part of self::$meta_boxes[$i][‘config’][‘name’] and therefore $arguments[‘meta_boxes’] is unset. So I suspect it is because these fields aren’t in the /parts/users folder, I’m guessing by following the flow, just getting familiar with Piklist. So, should i add these fields under /parts/users or it is supposed to work just by activating? but I don’t see where user-default.php is pulling these ‘meta_boxes’ from.

    in reply to: Demos: profile 'default' workflow tab missing info #3460
    vsalda
    Member

    I’ve been checking the code for the forms part, and I found it is handled by the class-piklist-form.php and it is used to generated forms in the front end by using a shortcode, awesome.

    So I guess I should add the fields needed for the default workflow tab to work.

    Victor

Viewing 4 posts - 1 through 4 (of 4 total)