Forum Replies Created
-
AuthorPosts
-
SteveKeymaster@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'); } }
SteveKeymaster@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.
SteveKeymaster@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.
February 21, 2015 at 10:35 am in reply to: Using piklist_taxonomies and piklist_post_types breaks WooCommerce endpoints #3336
SteveKeymasterYes, permalinks! Just visit Settings > Permalink’s (you don’t have to save).
See if that helps.
February 21, 2015 at 1:45 am in reply to: Using piklist_taxonomies and piklist_post_types breaks WooCommerce endpoints #3334
SteveKeymaster@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]
SteveKeymaster@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
SteveKeymasterInstead of returning
false, you should return a message:return __('is not unique', 'text-domain');Let us know if that works.
SteveKeymaster@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_postaction, 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);
SteveKeymaster@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.
SteveKeymaster@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.
SteveKeymaster@wpkonsulterna– Thanks for the idea. We are going to rethin relationships… all relationships. And will keep this in mind.
SteveKeymaster@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]
SteveKeymasterThis 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.
SteveKeymaster@Gregg– Great! Closing ticket.
SteveKeymaster@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)
-
AuthorPosts