Title: Please verify my code :)
Last modified: August 18, 2016

---

# Please verify my code :)

 *  [khaihar](https://wordpress.org/support/users/khaihar/)
 * (@khaihar)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/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 */

Viewing 1 replies (of 1 total)

 *  Thread Starter [khaihar](https://wordpress.org/support/users/khaihar/)
 * (@khaihar)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/please-verify-my-code/#post-292282)
 * K, i’m futzin’ with it now – and I definitly know this isn’t working as intended.
   <giggles>

Viewing 1 replies (of 1 total)

The topic ‘Please verify my code :)’ is closed to new replies.

## Tags

 * [added](https://wordpress.org/support/topic-tag/added/)
 * [field](https://wordpress.org/support/topic-tag/field/)

 * 1 reply
 * 1 participant
 * Last reply from: [khaihar](https://wordpress.org/support/users/khaihar/)
 * Last activity: [20 years, 6 months ago](https://wordpress.org/support/topic/please-verify-my-code/#post-292282)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
