I am trying to break, I mean mod some current code to add some extra features.
Here is the current function that I need to try and change, it is a custom function used in a phpbb modification to allow you to pull in a wordpress post in to your forum.
function wpu_do_crosspost($postID, $post, $future=false) {
global $wpSettings, $phpbbForum, $phpbb_root_path, $phpEx, $db, $auth;
$forum_id = false;
$found_future_xpost = false;
if ( (isset($_POST['sel_wpuxpost'])) && (isset($_POST['chk_wpuxpost'])) ) {
$forum_id = (int)$_POST['sel_wpuxpost'];
} else if ( $wpSettings['xpostforce'] > -1 ) {
$forum_id = $wpSettings['xpostforce'];
} else if($future) {
$phpbbForum->leave();
$forum_id = get_post_meta($postID, '_wpu_future_xpost', true);
if ($forum_id === '') {
$forum_id = false;
} else {
$forum_id = (int)$forum_id;
delete_post_meta($postID, '_wpu_future_xpost');
}
$phpbbForum->enter();
}
Now the only important thing here is $post Variable and this is the value I want to enhance.
What I want to do is add some extra data (my custom Variable $WPCustomfield in to the $post Variable.
This is what I would be trying to achieve
if $WPCustomfield not Null then $WPCustomfield + $post = $post
if (!isset($WPCustomfield)) {
$post = $post + $WPCustomfield;
}
Now I know the above two lines will not work but I am just trying to show you what I am trying to do 🙂
I am very new to PHP so any help or support on the above would be great