davidpetersen
Forum Replies Created
-
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?
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
In reply to: [CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy ErrorActually I think it was the hook thing. Thanks for the help though! You’re great.
Forum: Plugins
In reply to: [CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy ErrorI think the problem is solved. For some reason using the intval of the meetup_ID made it work. Any clue why?
Forum: Plugins
In reply to: [CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy ErrorThanks 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('https://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
In reply to: [CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy ErrorThanks 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('https://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
In reply to: [CPT-onomies: Using Custom Post Types as Taxonomies] Invalid Taxonomy ErrorLooking 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 )