Title: davidpetersen's Replies | WordPress.org

---

# davidpetersen

  [  ](https://wordpress.org/support/users/davidpetersen/)

 *   [Profile](https://wordpress.org/support/users/davidpetersen/)
 *   [Topics Started](https://wordpress.org/support/users/davidpetersen/topics/)
 *   [Replies Created](https://wordpress.org/support/users/davidpetersen/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/davidpetersen/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/davidpetersen/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/davidpetersen/engagements/)
 *   [Favorites](https://wordpress.org/support/users/davidpetersen/favorites/)

 Search replies:

## Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage] URL not rewriting correctly](https://wordpress.org/support/topic/url-not-rewriting-correctly/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/url-not-rewriting-correctly/#post-5848763)
 * So I found out that we are loading some of the posts through a plugin called 
   Camayak. The posts added through it work sporadically. Not all of them are broken.
   It’s weird. When I check broken posts, it looks like they have the correct metadata
   in the database. It’s just not concatenating correctly…. any thoughts?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Offload Media Lite for Amazon S3, DigitalOcean Spaces, and Google Cloud Storage] URL not rewriting correctly](https://wordpress.org/support/topic/url-not-rewriting-correctly/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/url-not-rewriting-correctly/#post-5848704)
 * Hey Folks,
    Thank you so much for your assistance. I’ll take a look at the amazon-
   s3-cloudfront.php file and see if I can find what’s not getting passed to the
   URL.
 * I’m just using the WP Media Uploader, not a plugin. The files I’ve checked have
   the appropriate metadata in the db.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy Error](https://wordpress.org/support/topic/invalid-taxonomy-error-1/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [12 years ago](https://wordpress.org/support/topic/invalid-taxonomy-error-1/#post-5005379)
 * Actually I think it was the hook thing. Thanks for the help though! You’re great.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy Error](https://wordpress.org/support/topic/invalid-taxonomy-error-1/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [12 years ago](https://wordpress.org/support/topic/invalid-taxonomy-error-1/#post-5005378)
 * I think the problem is solved. For some reason using the intval of the meetup_ID
   made it work. Any clue why?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy Error](https://wordpress.org/support/topic/invalid-taxonomy-error-1/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [12 years ago](https://wordpress.org/support/topic/invalid-taxonomy-error-1/#post-5005377)
 * Thanks for the help! Now I’ve created a hook for the wp_loaded action and it’s
   just giving a blank array.
 * Here’s the hook code
 *     ```
       <?php
   
       add_action('wp_loaded','addpart');
       function addpart(){
       	if ($_POST["sender_ID"] && $_POST["recipient_ID"] && $_POST["add_partnership"]){
   
       		$sender_ID = $_POST["sender_ID"];
       		$recipient_ID = $_POST["recipient_ID"];
       		$pitch= $_POST["pitch"];
       		$goal= $_POST["goal"];
       		$skill = $_POST["skill"];
       		$meetup_date = $_POST["meetup_date"];
   
       		//echo $sender_ID."<br><br>". $recipient_ID."<br><br>".$pitch."<br><br>". $goal."<br><br>".$skill."<br><br>". $meetup_date;
   
       		$sender = get_userdata(intval($sender_ID));
       		$recipient = get_userdata(intval($recipient_ID));
   
       		$meetup = array(
       		  'post_title'    => "Meetup between $sender->first_name $sender->last_name and $recipient->first_name $recipient->last_name",
       		  'post_content'  => $pitch,
       		  'post_status'   => 'publish',
       		  'post_type'	  => 'meetups',
       		  'comment_status' => 'open',
       		);
   
       		$meetup_ID = wp_insert_post( $meetup );
   
       		global $cpt_onomy;
   
       		print_r($cpt_onomy->wp_set_object_terms(  $meetup_ID , 'stars', 'goals' , true ));
       		add_post_meta($meetup_ID, 'possible_dates', $meetup_date);
       		add_post_meta($meetup_ID, 'sender', $sender_ID);
       		add_post_meta($meetup_ID, 'recipient', $recipient_ID);
   
       		wp_redirect('http://www.wisevice.com/meetups/'.get_post( $meetup_ID )->post_name);
   
       	}
       }
       ?>
       ```
   
 * If I var_dump the $cpt_onomy variable I get this : object(CPT_TAXONOMY), which
   makes me think that it IS registered and accessible. This is working on every
   other page I need it to. It’s just this page that’s a problem. This code is on
   the search page. Could that change anything?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy Error](https://wordpress.org/support/topic/invalid-taxonomy-error-1/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [12 years ago](https://wordpress.org/support/topic/invalid-taxonomy-error-1/#post-5005337)
 * Thanks for the response! My functions.php looks like this:
 *     ```
       <?php
       	//Create post types meetups and skills
       	require_once('functions/type-meetups.php');
       	require_once('functions/type-skills.php');
       	require_once('functions/type-skills-profiles.php');
       	require_once("functions/type-messages.php");
       	require_once("functions/type-goals.php");
       	require_once("functions/type-organizations.php");
       	require_once("functions/type-positions.php");
       	require_once("functions/type-schools.php");
       	require_once("functions/type-schools-profiles.php");
   
       	//Allow users to sign-in with email
       	require_once('functions/signin-email.php');
       	require_once('functions/remove-admin-slug.php');
   
       	//Functions to add friends and partnerships
       	require_once("functions/friend-functions.php");
       	require_once("functions/partner-functions.php");
   
       ?>
       ```
   
 * Then the partner-functions.php looks like this:
 *     ```
       <?php
   
       	function add_meetup($sender_ID, $recipient_ID, $pitch, $goal, $skill, $meetup_date){
   
       		//echo $sender_ID."<br><br>". $recipient_ID."<br><br>".$pitch."<br><br>". $goal."<br><br>".$skill."<br><br>". $meetup_date;
   
       		$sender = get_userdata(intval($sender_ID));
       		$recipient = get_userdata(intval($recipient_ID));
   
       		$meetup = array(
       		  'post_title'    => "Meetup between $sender->first_name $sender->last_name and $recipient->first_name $recipient->last_name",
       		  'post_content'  => $pitch,
       		  'post_status'   => 'publish',
       		  'post_type'	  => 'meetups',
       		  'comment_status' => 'open',
       		);
   
       		$meetup_ID = wp_insert_post( $meetup );
   
       		global $cpt_onomy;
       		$cpt_onomy->wp_set_object_terms(  $meetup_ID , 'stars', 'goals' , true );
       		add_post_meta($meetup_ID, 'possible_dates', $meetup_date);
       		add_post_meta($meetup_ID, 'sender', $sender_ID);
       		add_post_meta($meetup_ID, 'recipient', $recipient_ID);
   
       		exit();
       		wp_redirect('http://www.wisevice.com/meetups/'.get_post( $meetup_ID )->post_name);
       	}
   
       	if ($_POST["sender_ID"] && $_POST["recipient_ID"] && $_POST["add_partnership"]){
   
       		add_meetup($_POST["sender_ID"],$_POST["recipient_ID"], $_POST["pitch"], $_POST["goal"], $_POST["skill"], $_POST["meetup_date"]); 
   
       	}
   
       	if(isset($_GET["confirm"]) && isset($_GET["confirm_ID"])){
       			update_post_meta($_GET["confirm_ID"], 'confirmed_date' , $_GET["confirm"]);
       			wp_publish_post( $_GET["confirm_ID"] ) ;
       		}
       ?>
       ```
   
 * It’s just called when the page loads, but I’m not using a hook. I’ve tried including
   the partner-functions.php in functions.php using the wp_loaded hook and it did
   change the error message. The function just returned a blank array.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy Error](https://wordpress.org/support/topic/invalid-taxonomy-error-1/)
 *  Thread Starter [davidpetersen](https://wordpress.org/support/users/davidpetersen/)
 * (@davidpetersen)
 * [12 years ago](https://wordpress.org/support/topic/invalid-taxonomy-error-1/#post-5005262)
 * Looking through the code it seems like it’s not finding the taxonomy that I input.
   Here’s the source:
 * $cpt_onomy->wp_set_object_terms( $meetup_ID , ‘goal-slug-that-user-enters’, ‘
   goals’ , true )

Viewing 7 replies - 1 through 7 (of 7 total)