WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
How can I show custom taxonomy in WP User Frontend. (15 posts)

  1. dhruva
    Member
    Posted 2 years ago #

    Sir,
    I am making a quote collection website, where users can submit quotes from front end. In addition to post quote user can also submit two type of tags
    1. Quote author
    2. Quote topic

    How can I show these two taxonomy in frontend post form.
    please help.

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. caballero600
    Member
    Posted 2 years ago #

    In my case, taxonomy is showing automatically in the front end form. It appears with a dropdown, but even if a value is selected it gets changed this way:

    Imagine there is a "section" taxonomy, and you select "photography" when you are submiting a post. The plugin changes it to a custom filed called "ct_section" = 8. And the taxonomy is not selected properly.

    Any idea how to fix this?

  3. Tareq Hasan
    Member
    Plugin Author

    Posted 2 years ago #

    @dhruba, the plugin can be extended. Here are some examples given, you might want to try

    @caballero600 I am not really sure how the taxonomy is getting changed after submitting. Can you elaborate?

  4. caballero600
    Member
    Posted 2 years ago #

    @Tareq Hasan, I'm not really sure how to elaborate it more.

    I'm using it with a custom type. This custom type has a taxonomy created, so in the posting form, this taxonomy appears like a dropdown field.
    When I choose a value in this dropdown, and submit the post, instead of appearing the taxonomy correctly chosen, a new custom field is created with: (name) ct_section and (value) 8, for example.

  5. Tareq Hasan
    Member
    Plugin Author

    Posted 2 years ago #

    Which version of this plugin are you using?

  6. caballero600
    Member
    Posted 2 years ago #

    I'm using 0.7

  7. Tareq Hasan
    Member
    Plugin Author

    Posted 2 years ago #

    The plugin doesn't support taxonomy right now. You can check this link to add custom form elements using action hooks.

  8. WAXFROGDESIGN
    Member
    Posted 2 years ago #

    We have custom coded the option to have multiple custom taxonomies and categories in this plugin.

    Works great! Talk to us if you're interested.

  9. caballero600
    Member
    Posted 2 years ago #

    Can you share that code please? That would be great!

  10. ayko469
    Member
    Posted 2 years ago #

    I am also interested in the code for multiple custom taxonomies - any hint on how to get it???

  11. MarceFX
    Member
    Posted 1 year ago #

    @WAXFROGDESING, can you help with custom taxonomies? How you call another taxonomy on this plugin? I'm using 'attributes' from Woocommerce. Thank you

  12. J Grandin
    Member
    Posted 1 year ago #

  13. kevindank
    Member
    Posted 1 year ago #

    WAXFROGDESIGN, Please share the code to add Custom Taxonomies to WP User Front End...or atleast supply your e-mail address so someone can actually email you

  14. MarceFX
    Member
    Posted 1 year ago #

    Hi guys,

    I emailed the author of the plugin a couple of weeks ago and got this message:

    If it's a taxonomy, use it like this (on wpuf-addpost.php):

    wp_dropdown_categories( 'show_option_none=' . __( '-- Select --', 'wpuf' ) . '&hierarchical=1&taxonomy=pa_attribute&hide_empty=0&orderby=name&name=category[]&id=cat&show_count=0&title_li=&use_desc_for_title=1&class=cat requiredField&exclude=' . $exclude );

    I haven't had time to implement it since we decided to use another plugin.

    Good luck!

  15. gerencia@enjambregroup.com
    Member
    Posted 1 year ago #

    Hi Tareq, thanks for this great plugin!!

    I need some help, im trying to make it works without success, i need to add a custom taxonomy (im using taxonomy manager, my taxonomy name is “provincias”)

    i added this function to my functions.php :

    function wpufe_taxonomy( $post_type, $post = null) {
    
    wp_dropdown_categories( ‘show_option_none=’ . __( ‘– Select –’, ‘wpuf’ ) . ‘&hierarchical=1&taxonomy=provincias&hide_empty=0&orderby=name&name=provincias&id=cat&show_count=0&title_li=&use_desc_for_title=1&class=cat requiredField&exclude=’ . $exclude );
    
    }

    after that i add this in functions.php :
    add_action( ‘wpuf_add_post_form_description’, ‘wpufe_taxonomy’, 10, 2 );

    after that this:

    if (function_exists(‘wpufe_taxonomy’)) {
    add_action(‘wpuf_add_post_after_insert’, ‘save_taxonomy_data’);
    }

    at the end i added this to the same functions.php file:

    function save_taxonomy_data($post_id) {
    // verify this came from our screen and with proper authorization.
    
    if ( !wp_verify_nonce( $_POST['taxonomy_noncename'], __FILE__ )) {
    return $post_id; }
    
    // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything
    if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE )
    return $post_id;
    
    // Check permissions
    if ( ‘post’ == $_POST['post_type'] ) {
    if ( !current_user_can( ‘edit_page’, $post_id ) )
    return $post_id;
    } else {
    if ( !current_user_can( ‘edit_post’, $post_id ) )
    return $post_id;
    }
    
    // OK, we’re authenticated: we need to find and save the data
    $post = get_post($post_id);
    if ($post->post_type == ‘post’) {
    $select_name = $_POST['provincias'];
    wp_set_object_terms( $post_id, $select_name, ‘provincias’ );
    }
    }

    So, i can see the taxonomy (provincias) dropdown in the creation of a new post from frontend, but when i save, the selected taxonomy doesnt get saved.

    Something is missing or bad coded?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic