Please verify my code :)
-
I have placed the following in the WP-ADMIN/POST.PHP file, just after line 145. The idea is to capture the post_ID, find out if there’s already text in Forum_Link field of that post, if not, run another query to another database (the insert_post function, that returns a value), then place that Returned Value into the Forum_Link field I added to the wp_post Table.
Don’t worry about the Insert_Post function, just pretend it returns “a value”. ??
Are there any glaring errors to be seen? I’m an extreme newbie, but like to think I’m very adaptable. Thank you for any comments/questions. Feel free to message me at middae !at hotmail -Dot- com for any add’l info.
/*Custom Coding for adding Forum Link to post*/
//grab $post_ID from WP procedures
$cstPostQuery = “SELECT forum_link FROM $wpdb->posts WHERE ID = $post_ID”;
$cstMKBH_result = “”;
$cstMKBH_result = $wpdb->query($cstPostQuery);
if $cstMKBH_result = “” {
$cstMKBH_WPpostID = $post_ID;
//insert Forum Topic with Post Info, may need to change $content string.
$cstMKBH_retval = $insert_post($content,$post_title, 1, 1, ‘baldeagle152′,’User attach Sig here’);
//add the Topic_ID and post_ID to the forum_link field in WP_POSTS
$cstPostQuery =”UPDATE $wpdb->posts SET forum_link = $cstMKBH_retval WHERE ID = $cstMKBH_WPpostID”;
$cstMKBH_result = “”;
$cstMKBH_result = $wpdb->query($cstPostQuery);
}
/* end Custom Coding */
- The topic ‘Please verify my code :)’ is closed to new replies.