WordPress.org

Ready to get started?Download WordPress

Forums

CPT-onomies: Using Custom Post Types as Taxonomies
CPT-onomies with Gravity Forms (2 posts)

  1. pixeledmedia
    Member
    Posted 1 year ago #

    I've noticed that when a cpt-onomy is attached to another cptonomy e.g:

    Venue is attached to Facilities; a meta box in the Post Edit page is created showing either a drop down, check box or an auto-complete; with the option to assign a CPT (cpt-onomy) to another CPT.

    Is it possible to show this meta box in the front-end for users to assign CPT's by themselves on a page or in a post?

    If not, is it possible for front-end users to assign certain CPT's; but by using Gravity Forms, instead of accessing the back-end?

    Thanks!
    (Great plugin by the way)

    http://wordpress.org/extend/plugins/cpt-onomies/

  2. Rachel Carden
    Member
    Plugin Author

    Posted 1 year ago #

    I don't know much about Gravity Forms functionality but it is definitely possible to assign CPT-onomy terms via the front-end, if you know the right functions to use.

    If you want to display a dropdown list of terms, wp_dropdown_categories() will take care of business. Check out wp_dropdown_categories() in the codex for more information about the arguments you can use.

    Let's say you're showing a dropdown of facilities:

    wp_dropdown_categories( array(
       'show_option_none' => 'No facilites are selected',
       'orderby' => 'name',
       'order' => 'ASC',
       'hide_empty' => false,
       'name' => 'facilities',
       'taxonomy' => 'facilities
    )

    wp_terms_checklist() is also an option.

    There are a plethora of functions for retrieving/displaying terms. Check out the CPT-onomies documentation for a list.

    To assign CPT-onomy terms from the front-end, simply use $cpt_onomy->wp_set_object_terms(), the CPT-onomy version of WordPress's wp_set_object_terms() for taxonomies.

    I hope this helps you get started.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.