Wordpress: Post and user objects with the same ID

0

The project in which we are working requires assigning a personalized taxonomy to users who in turn are related to a custom post type, that is, we want to tag posts and users with the same custom term.

The problem is that the user object generates ids independently of the posts, that is, there is a risk that a user has the same id as a post with which the relationship of the taxonomies would not help.

The question: is there a possibility, either by sql or via wp callback, that users and posts have a single id altogether? That is, do not overlap.

Thank you in advance for your attention.

    
asked by Ronnie Esponja 20.01.2017 в 20:51
source

2 answers

0

You can set a threshold for each type of thing. For example, users could start from ID 1000000, with ID 1000001 first.

I propose to do this with a small hack. First open your mysql DB. You have to go to table xx_USERS. Check your last user ID. Modify it manually with the value 1000000.

As of that moment Wordpress will create the users from the indicated ID manually.

PS: The same can be done with POST. Although with the post is more complex because the ID of the post is shared with the images and other content.

    
answered by 29.01.2017 / 03:35
source
0

Thanks, this solves the problem. Keep in mind that, it is unlikely but there is a possibility, the number of users / post of their respective ranges of IDs will be exceeded and overlap. Anyway this is the best solution without a doubt.

    
answered by 30.01.2017 в 11:09