• Resolved Attacking3rd

    (@attacking3rd)


    Hello,

    I have been asked to work on a solution that has been started (but not completed) that uses CPTUI to create a custom post type and taxonomy. The taxonomy, zip_codes, is attached to the custom post type service_offerings.

    I would like create JSON containing all the zip_code values.

    Do I need the Custom Post Type UI Extended plugin to do this? If not, can you please point in the right direction on how to start doing this? I am a long time web developer but relatively new to WordPress and custom taxonomies.

    Thanks,

    robertg

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Good day @attacking3rd

    That is not something that CPTUI-Extended offers. It is basically a shortcode-based GUI that pieces together arguments for a WP_Query call and then also renders the results with a basic template. It does offer some other items on the CPTUI post type edit screen and also network-wide post types/taxonomies with multisite.

    Regarding your questions above, are you just needing to fetch all of the terms in the zip_codes taxonomy, regardless of any post type post associations? If you know how to query for terms, then passing the results into https://secure.php.net/manual/en/function.json-encode.php should be pretty straightforward. If you’ve ever browsed to CPTUI’s “Tools” area, the right side textarea for the post types and taxonomies tabs is JSON. Before output, we fetch the option for the content type, and json_encode() the results into the textarea. When someone pastes the results into the left textarea, we grab the data from the submission, and pass it through json_decode() before updating the option.

    Thread Starter Attacking3rd

    (@attacking3rd)

    Thank you for the quick reply and info Michael.

    The project scope has just changed and I no longer need to build JSON on page load.

    Thanks again for your time, help and providing this useful plugin.

    robertg

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome. Sounds like it was going to be an interesting feature. Also, something I wasn’t thinking of at the time is that WordPress now ships with a JSON-based REST API, that you could have also gotten taxonomy terms from. No custom encoding/decoding needed from you.

    Nonetheless, hope it’s a good project ??

    Thread Starter Attacking3rd

    (@attacking3rd)

    I’ll have to check out the JSON-based REST API feature as I am sure it could be helpful at some point.

    Enjoy your weekend!

    robertg

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need to use Custom Post Type UI Extended to do this?’ is closed to new replies.