WordPress.org

Forums

User Taxonomies
Don't share taxonomies between users and posts (4 posts)

  1. boxcarpress
    Member
    Posted 2 years ago #

    Looking at the database structure, I don't think that you should share taxonomies between any type of post and a user. There is no way for WordPress to distinguish whether the object_id in the wp_term_relationships table is a post ID or a user ID. So, you may be applying the taxonomy to posts when you indent users and vice versa. Correct me if I'm wrong.

    http://wordpress.org/plugins/user-taxonomies/

  2. mfrerebeau
    Member
    Posted 2 years ago #

    Hello,
    I've just seen this plug-in and the possibilities seem to be very interesting. But I need to share taxonomies between any type of post and users.

    I Think there is a way for WordPress to distinguish whether the object_id in the wp_term_relationships table is a post ID or a user ID : it need that WordPress see wp_term_taxonomy table where there is object type. It could do it with a SQL WHERE clause.

    And it need that the string "user" be reserved to the users and doesn't used for a post type named "user"...

    [edit] In fact, that's right wp_term_taxonomy haven't field to know witch table linked to... A field should be added with the table concerned... In MERISE Method we must create a new specific relation between user and wp_term_taxonomy tables...

  3. boxcarpress
    Member
    Posted 2 years ago #

    I suppose it's possible to filter the WP Query to inject your WHERE clause but this would be a bad idea. This problem is better avoided altogether by creating new taxonomies for users. In other words, do this:

    register_taxonomy('mytaxonomy','post', $args);
    register_taxonomy('user_mytaxonomy','user', $args);

    NOT:

    register_taxonomy('mytaxonomy',array('post','user), $args);
  4. Umesh Kumar
    Member
    Posted 2 years ago #

    Here is another plugin with User Taxonomy option, instead of manually registering you can register directly.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Taxonomies
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.