Forum Replies Created

Viewing 15 posts - 1,921 through 1,935 (of 2,964 total)
  • Author
    Posts
  • in reply to: Validate Unique value #3345
    Steve
    Keymaster

    @justin– I think the usage of WP_User_Query is off. Use this post by Tom Mcfarlin for reference >

    Try this. It worked for me:

    add_filter('piklist_validation_rules', 'check_if_unique', 11);
    function check_if_unique($validation_rules)
    {
      $validation_rules['custom_unique'] = array(
        'callback' => 'my_validate_unique'
      );
     
      return $validation_rules;
    }
     
    function my_validate_unique($file, $field, $arguments)
    {
      $user_query = new WP_User_Query( array( 'meta_key' => 'user_custom_url', 'meta_value' => $field) );
    
      $users = $user_query->get_results();
    
      if(empty($users[0]))
      {
        return true;
      }
      else
      { 
        return __('is not unique', 'your-text-domain');
      }
     
    }
    
    in reply to: Can I access the beta now from github? #3343
    Steve
    Keymaster

    @kristjan07– We would be happy to give it to you if it was ready for testing… but it’s not. However, the good news is that Piklist already does everything “Fields and Forms” does… just without a UI.

    in reply to: Widgets not showing #3338
    Steve
    Keymaster

    @gregg- currently Piklist groups widgets by their plugin or theme. There is no setting to remove this.

    I’m curious why you don’t like this. The WordPress widget page is pretty dysfunctional when there are lots of widgets.

    Steve
    Keymaster

    Yes, permalinks! Just visit Settings > Permalink’s (you don’t have to save).

    See if that helps.

    Steve
    Keymaster

    @cdcorey– I’m trying to reproduce but I can’t. Here’s what I’m doing:
    -Piklist > Demos > activate.
    -The Piklist Demos register custom post types and taxonomies using the Piklist filters.
    -Pages > My Account > edit your password and account details.

    This works for me.

    Could you send us the custom CPT and Tax code you were using that is breaking Woocommerce? Email to [email protected]

    in reply to: Notice: trying to get property of non-object #3333
    Steve
    Keymaster

    @justin– This is really odd. I can’t reproduce this. Can you send us your system information?

    -Tools > Toolbox
    -‘Develop’ tab
    -Check ‘Show System Information’ and save.
    -Tools > System Information
    -Copy and paste that first box into an email and send to [email protected]

    Thanks

    in reply to: Validate Unique value #3332
    Steve
    Keymaster

    @justin

    Instead of returning false, you should return a message:

    return __('is not unique', 'text-domain');
    

    Let us know if that works.

    in reply to: Piklist error on older wordpress install… #3325
    Steve
    Keymaster

    @Marcus– If you really want to help them, you should upgrade their version of WordPress since they are running an insecure version.

    WordPress 3.7 added a third parameter to the save_post action, which Piklist takes advantage of.
    FILE: wp-includes/post.php
    WordPress 3.5: do_action('save_post', $post_ID, $post);
    WordPress 3.7: do_action('save_post', $post_ID, $post, $update);

    in reply to: New Conditional Bug… YAAAY! #3323
    Steve
    Keymaster

    @justin– We believe we have a fix for this issue. I will be sending you a beta version of Piklist in the next few days.

    in reply to: New Conditional Bug… YAAAY! #3321
    Steve
    Keymaster

    @justin– You definitely found a bug. This code works great for post_meta, but not Users. We will put it on the list of fixes we need to address.

    in reply to: Post-to-user relationship #3320
    Steve
    Keymaster

    @wpkonsulterna– Thanks for the idea. We are going to rethin relationships… all relationships. And will keep this in mind.

    in reply to: Taxonomies for users #3317
    Steve
    Keymaster

    @vondervick– This is getting a bit confusing. Without seeing all your code I don’t think we can help you much. Feel free to zip it up and email to [email protected]

    in reply to: Taxonomies for users #3315
    Steve
    Keymaster

    This is totally untested. The only thing I don’t know is how you are associating a Client to a Trainer. You will have to fill in that logic.

    add_filter('piklist_taxonomies', 'my_custom_taxonomies');
    function my_custom_taxonomies($taxonomies)
    {
      global $current_user;
    
      get_currentuserinfo();
    
      if (current_user_can('edit_posts')) // You're a Trainer
      {
        $trainer_id = $current_user->ID;
      }
      else // You're a Client
      {
        // Find the association between the Client and Trainer.
        // Get the Trainer's user_id.
        $trainer_id = $trainer->ID;
      }
    
      $trainer_info = get_userdata($trainer_id); // Get all user info for Trainer
    
      // Register Taxonomy for the Trainer
      $taxonomies[] = array(
        'post_type' => array('post')
        ,'name' => 'personal_tags_' . $trainer_id // Append User ID to taxonomy name
        ,'configuration' => array(
          'hierarchical' => false
          ,'labels' => piklist('taxonomy_labels', $trainer_info->display_name . "'s Tag") // Append user name to Taxonomy labels
          ,'show_ui' => true
          ,'query_var' => true
          ,'rewrite' => array(
            'slug' => 'personal_tags_' . $trainer_id->ID // Append user ID to taxonomy slug
          )
          ,'show_admin_column' => true
          ,'comments' => true
        )
      );
    
      return $taxonomies;
    }
    

    Let me know if this makes sense.

    in reply to: Widget: Array to string conversion Error #3313
    Steve
    Keymaster

    @Gregg– Great! Closing ticket.

    in reply to: Taxonomies for users #3311
    Steve
    Keymaster

    @vondervick– Welcome to the Piklist community!

    That tutorial was inspired by another Piklist user that wanted that kind of functionality. The goal was to give each LOGGED IN user their own taxonomy. If User One is logged in, then only that taxonomy is registered… the other taxonomies don’t even exist.

    It doesn’t sound like this is the type of functionality you really want.

    What functionality are you trying to achieve?

    (I moved this topic to it’s own post since it had nothing to do with the original)

Viewing 15 posts - 1,921 through 1,935 (of 2,964 total)