Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter payges

    (@payges)

    Hi Robin,

    I’m back and was hoping to resume troubleshooting this matter.

    But i would like to do it via private messaging so that i can show you info clearly and also anything you yourself request…

    Thread Starter payges

    (@payges)

    Robin,
    Apologies for going awol…its just something I’m working on my spare time..and right now in the middle of a house move…
    Even though it’s important I can’t tend to it just yet..Can I have look and response on Sunday?
    Thanks

    Thread Starter payges

    (@payges)

    …And thats with me not logged in..on another browser and logged out…

    Thread Starter payges

    (@payges)

    Robin, thanks for your prompt reply.
    Yes they are appearing in google searches…
    screenshot here:
    https://mrdf.box.com/s/y7daxggqfem0opas0qb3r045ve6f1xnu

    I have set the forums to private
    I have se up groups and made the forums only accessible to particular groups
    None of the forums are public
    all of this seems to be working for users…

    but as mentioned the url forums/user/ seems to be returning results and they are clickable i can actually read replies/favorites/profile of users

    Thread Starter payges

    (@payges)

    Thanks for your prompt reply
    But i want to update the post content (post_content) in wp_posts…
    anyhow i replaced wp_update_post() with:
    global $wpdb;
    $query = “UPDATE “.$wpdb->prefix.”posts SET post_content='”.$content.”‘ WHERE ID = ‘”.$existing_forum_id.”‘”;
    $wpdb->query($query);

    and it worked fine ??

    thanks again

    Thread Starter payges

    (@payges)

    found this…just fishing without a rod though ??

    But, as @rast said, it is very probably that your problem is with some of these actions hooked by third party code (from another plugin or from the theme). These actions are triggered by wp_update_post() and it is commonly used to update post meta fields, specially save_post action. It is very probably that when these actions are triggered without meta information, like your code does, the third party code deletes the meta fields.

    from https://wordpress.stackexchange.com/questions/227824/wp-update-post-deletes-post-meta-in-cpt

    Thread Starter payges

    (@payges)

    Just to add:
    when i first create the group/forum and assign, I have the following example entry in the database table wp_postmeta

    meta_id (11887), post_id (4321), meta_key (_private_group), meta_value (Group45)

    when I add information later by only updating the forum post content, the entry is gone – using wp_update_post()

    Thread Starter payges

    (@payges)

    Thank you for the info.
    I managed to figure all that out before seeing your reply ..took me a while ..but great for my general learning LOL!!!

    Basically my setup has classes that require private forums.

    I have managed to achieve the following dynamically:
    1. create a new group
    2. create a new forum
    3. assign the group to the forum
    4. when users successfully sign up to the class..they are also automatically added to the group.

    Today, i have attempted the following.
    To assign another class to the same forum.

    Run into a problem..was hoping you could shed any light and maybe i’ll figure out if I have bug somewhere:

    When updating the content of the forum post (basically adding classes information) it seems to wipe out the groups checked for that forum???

    I’m using wp_update_post() and only passing the id and the updated content..nothing else…
    I would assume i have bug somewhere in my code as can’t see it related to groups but just asking in case…

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