Forum Replies Created
-
I just figured out what I needed. It turns out bbp_get_forum_title() returns a string that I can actually compare and it seems to work perfect. So my issues in my last message can be ignored.
Just for clarity, this is what the final piece looks like:
<?php if (bbp_get_forum_title() !== "News") : ?>
Then I just add the endif you suggested at the end and it works great.
Thanks again!
Thanks, this definitely helps get me on the right path. Since I am just removing the form to make new topics on the one forum, I don’t even need to worry about user permissions, I can block it for even the keymaster since I am using the bbPress Topics for Posts plugin which I have set to automatically make a news topic when I post a new blog post to the main page, which is all I need.
I am still running into issues though. bbp_is_single_forum() doesn’t seem to take any arguments. I started looking at other possibilities and found the bbp_forum_title() function which returns “News” or whatever the name of my forum is, but it seems to only print it to screen and not give it to me in anyway I can actually do a string compare. Same thing with bbp_forum_id(). bbp_form_forum_title() and other things I’ve tried seem to return nothing. I’ve tried using strip_tags and trim but it still just prints to screen and ignores my if statement.
This would be an ideal solution if I could just get the title string and do a string compare against “News” which then hide the form. I’m pretty new to php. I’ve got quite a bit of programming experience in other languages though, esp Java. So It’s likely I am just making a simple mistake with syntax or something.
Thanks again. I’ll keep experimenting and see if I can figure out anything.