Skip to:
Content
Pages
Categories
Search
Top
Bottom

How comments_open() function operates in bbpress topics


  • common8308
    Participant

    @common8308

    I was fixing a certain existing WP plugin to my taste to make it work in bbpress, and experienced comments_open() function is not stably working in bbpress.

    In most cases it returned true in open topics/replies. but in less than 5% cases it returned false although the topic was open and making replies were available..

    I just replaced comments_open() function to (is_user_logged_in() && is_bbpress()) and it worked fine. (Thank you for this function!)

    I don’t think it’s not much important in using bbpress, but just curious to know how comments_open() function works in bbpress if it’s not too complicated.

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

  • amirsaam
    Member

    @7i7griffin

    comments_open() function have a sister function that used in bbPress or the bbPlugin. They looks like topic_is_open( $bb_post->topic_id ) (bbPress) or bbPlugin (I’m not sure!) bbp_topic_is_open(bbp_post->bbp_topic_id)

    I repeat that I’m not sure about bbPlugin!


    common8308
    Participant

    @common8308

    Thank you so much for the fast reply! I guess bbp_topic_is_open() will do for me..

    Might be a silly question but is it recommended not to use comments_open() in bbpress?


    amirsaam
    Member

    @7i7griffin

    Nope, that function is absolutely diffrent and not used in bbPlugin :)


    common8308
    Participant

    @common8308

    @7i7GRiFFiN Thank you again! :)


    amirsaam
    Member

    @7i7griffin

    Oops! A $ is missed in the code :-D Use it bbp_topic_is_open( $bbp_post->bbp_topic_id )

    And again I’m not sure about this code that work or no!

    And, your welcome :-)

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar