PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Another Custom Taxonomy Question

  1. I've got multiple forms that will be posting to a single Custom Post Type, and I'd like to be able to add a taxonomy term to each in order to filter them for displaying on separate pages.

    Using the code by Alex Cancado from this post, I've edited it down to this, which works only when logged in:

    /* Custom Post Type & Taxonomy Form Hooks */
    
    add_filter("gform_post_data", "new_post_type", 10, 2);
    function new_post_type($post_data, $form){
    
    	$post_data["post_type"] = "free-services";
    
        if($form["id"] == '3'){
    
    		$post_data["tax_input"] = array("service-types" => "psa-and-events");
    
        }
        return $post_data;
    }

    Like I said, when I'm logged into WP and fill out the form, the custom taxonomy comes in perfectly. When I'm logged out I get nothing. I'm wondering how I can get it to work without being logged in too.

    Thanks,

    Posted 13 years ago on Wednesday December 1, 2010 | Permalink
  2. Hi Bryan. Not seeing anything here that would make this logged-in only. Could you post the entire file you have this code in to pastie.org or pastebin.com. You can post a link here or email me directly at david@rocketgenius.com.

    Posted 13 years ago on Thursday December 2, 2010 | Permalink
  3. David,

    Thanks for looking into this. Here's a link to the functions.php file code:

    http://pastie.org/1342712

    Posted 13 years ago on Thursday December 2, 2010 | Permalink
  4. Hi Bryan, Still not seeing anything that would prevent this from working for non-logged-in users. Would you mind sending me a login to your WP install and FTP access? If not, send to david@rocketgenius.com.

    Posted 13 years ago on Thursday December 2, 2010 | Permalink
  5. Sorry David for not replying... I've got this project on a server with a load of other clients and am a little wary of giving out creds. I'll keep poking around to find out what and why and if I can move it over to an independent server I'll get you access.

    Posted 13 years ago on Thursday December 16, 2010 | Permalink