• boxcarpress

    (@boxcarpress)


    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.

    https://www.ads-software.com/plugins/user-taxonomies/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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…

    Thread Starter boxcarpress

    (@boxcarpress)

    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);

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Don't share taxonomies between users and posts’ is closed to new replies.