• Resolved polykrom

    (@polykrom)


    Hi all !

    I need to create a User based Custom Post, Custom Taxonomy creation.

    So in Admin and Frontend i can related the Creation/Update & Delete to the current logged in user.

    Is there a relationShip table to do this ? , or have i to create one myself (meta) ? Maybe already implemented in WP (If Yes, How can i create/get/update/delete datas for this ?).

    thanks a lot 🙂

Viewing 1 replies (of 1 total)
  • Thread Starter polykrom

    (@polykrom)

    Re,

    I think i figure out this topic.

    To create a user based Term in Custom Taxonomy, i’ve created a meta attached to the term (new WP 4.4 feature) ‘author’ which contains the logged in user ID :

    add_term_meta($term_id,'author',get_current_user_id());

    and then to retrieve the user who has created the term :

    $author = get_the_author_meta( 'user_nicename', intval(get_term_meta($term_id,'author')) );

    I think it’s the best way to do it.

    cheers !

Viewing 1 replies (of 1 total)

The topic ‘Custom Taxonomy user based creation’ is closed to new replies.