• Hi

    I have used Pods to create two Pods. One with all the Articles in it and one with the Authors of them. The problem for the moment is that i need to make a copy of two fields from within the Author’s Pods CPT to a custom taxonomy. It’s the names fields i need. First name and last name.

    How can i make a copy of them to a custom taxonomy without deleting them from the Pods CPT. I of course need to keep the relationship to the ID in the Articles Pod ?

    Is there a plugin which can do this ?

    All the best
    Carsten

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    If you cannot find such a plugin, it could be custom coded, but keeping the data in sync could get messy. Creating redundant data like this is rarely a good idea. Why do you need names as taxonomy terms? Why wouldn’t you just query for desired data by name fields instead of by taxonomy term?

    Thread Starter boblebad

    (@boblebad)

    I want to use Posts Table Pro for the display of custom post types via Pods. The problem is that it can’t do search/sort-click on the columns with CPT relationship fields, only taxonomy.

    I’m just done whit messing around with the code and having to code the display page from scratch in Pods Templates. I just need something i can feed my data into and it can display them in a nice ordered way ??

    And yes, i know i will have to update both the author field and taxonomy. At the moment i just want to keep the field and then figure out if i’m going to be needing it. It depends wether or not i want to do more regarding the authors. I’m not sure at the moment.

    I found out that with a little formular-magic in Excel, i can do a search-and-replace depending on a 3rd field. So in a way that part of the problem is solved.

    I haven’t found other plugins that can display the data in this nice clean way with those functions.

    EDIT: I use Divi.

    • This reply was modified 2 years, 9 months ago by boblebad.
    Moderator bcworkz

    (@bcworkz)

    It can sort by a taxonomy term name but not by post meta value? That’s odd since WP_Query doesn’t support term name post ordering, but does for post meta. Term name ordering is fine as long as it works, it’s just curious.

    If a WP_Query request for ordering by a click event can be intercepted in “pre_get_posts” action, ordering by a meta field would be relatively easy to accomplish. The trick would be making a term column head clickable. I know how it’s done in the admin list table with added columns. But for Posts Table Pro I have no idea unless it’s based on the WP_Posts_list_Table class.

    IMO that would be the better solution, but to answer your question, you could query for a set of post meta values. Loop through the results, creating taxonomy terms with wp_insert_term(). Associate the new term with a specific post with wp_set_post_terms().

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate CPT to custom taxonomy’ is closed to new replies.