Skip to:
Content
Pages
Categories
Search
Top
Bottom

Navigation bar

Published on January 12th, 2024 by sotekt

Hey guys am quite new to these just install a bbpress in my wordpress. Added Some categories and some forums with perent… and while trying to use the forums i cant get the way how to go back to the main forums categories.

Any tips? thanks

Topics Created via API Aren’t Showing

Published on January 12th, 2024 by rilliencot

WordPress Version: 6.4.2
bbPress Version: 2.6.9
Link to site: Unavailable (Site created using LocalWP and still hosted locally)

When I create topics through the standard frontend or backend, the new topic shows up in the forum perfectly.

However, if I create a new topic using a plugin extension I’ve cobbled together, the new topic does not show up on the front end of the website (despite it being created and visible on the back end).

The plugin written in php is as follows (thanks to work from here and here):


<?php
/**
 * Plugin Name:       bbPress API
 * Description:       Exposing the bbPress post types to WP API.
 * Author:            Rillien Cot
 * Version:           1.3.0
 */

/**
 * Add REST API support to an already registered post type.
 */
add_action('init', 'register_bbp_post_types', 25);

function register_bbp_post_types() {
    global $wp_post_types;

    $post_type_name =  bbp_get_reply_post_type();
    if (isset($wp_post_types[$post_type_name])) {
        $wp_post_types[$post_type_name]->show_in_rest = true;
        $wp_post_types[$post_type_name]->rest_base = $post_type_name;
        $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
    }
    $post_type_name =  bbp_get_topic_post_type();
    if (isset($wp_post_types[$post_type_name])) {
        $wp_post_types[$post_type_name]->show_in_rest = true;
        $wp_post_types[$post_type_name]->rest_base = $post_type_name;
        $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
    }
    $post_type_name =  bbp_get_forum_post_type();
    if (isset($wp_post_types[$post_type_name])) {
        $wp_post_types[$post_type_name]->show_in_rest = true;
        $wp_post_types[$post_type_name]->rest_base = $post_type_name;
        $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
    }

    // Add custom REST API endpoint for creating bbPress topic
    add_action('rest_api_init', 'create_bill_endpoint');
}

function create_bill_endpoint() {
    register_rest_route('pnyx/v2', '/bill/', array(
        'methods' => 'POST',
        'callback' => 'create_bill',
    ));
}

function create_bill($data) {
    // Extract necessary data from the request
    $forum_id = $data['forum_id'];
    $topic_title = $data['topic_title'];
    $topic_content = $data['topic_content'];
    $bill_id = $data['bill_id'];

    // Create a new bbPress topic
    $topic_args = array(
        'post_title' => $topic_title,
        'post_content' => $topic_content,
        'post_type' => bbp_get_topic_post_type(),
        'post_status' => 'publish',
        'post_parent' => $forum_id, // Set the post_parent to the forum ID
    );

    $topic_id = wp_insert_post($topic_args);
?>

Basically, it exposes the Forum, Topic, and Reply post types from bbPress to standard wp-json/v2 namespace and then adds an additional endpoint (‘create_bill’) which allows me to add a new topic and associate it with a forum via ‘post_parent’. (I wonder if this is where the problem is?)

I create a new topic using the following python script:


import requests
import json

# Set WordPress API authentication details
username = "*******"
password = "**********************"
auth = requests.auth.HTTPBasicAuth(username, password)

# Values for new post data
new_post_data = {
    "forum_id": 40, # <- This is a valid post id of a forum.
    "topic_title": "New API Topic Title",
    "topic_content": "Lorem ipsum content for the new topic"
}

# Make the POST request to create a new post
wordpress_api_url = "http://pnyx.local/wp-json/pnyx/v2/bill/"
response = requests.post(
    wordpress_api_url,
    auth=auth,
    headers={
        'Content-Type': 'application/json',
    },
    data=json.dumps(new_post_data)
)

The topic is created, and I can see it in Dashboard>>Topics>>All Topics. And I can view it by going directly to the link associated with it, but I can’t see it on the actual frontend of the forum.

I’ve deactived all other plugins and I’m still getting this issue. The only differences between the two (as far as I can tell) are the Author IP (API created topics leave this field blank, standard fills it with 127.0.0.1) and the number of voices (API created topics have 0, standard created topics have 1). All the other settings seem identical (visibilty = public, type = normal, status = open).

Any insights as to what I’m missing and how to rectify the situation are greatly appreciated, thanks!

Forum Index Page Titile

Published on January 10th, 2024 by Tory

Hello, I am using the latest version of bbPress along with the generatepress theme. I used Method 2 on the getting started instructions and set the forum root slug to “community”, and created a page titled “Community”, with the slug “community”. I used

on the page.

My only issues are the page title (in the <title> tag) is “Forums Archive”, and I can’t seem to change it. And my breadcrumb trail is Home >> Forums. Somewhere, my site is pulling the term “Forums” for the <title> and breadcrumb (it’s a Rankmath breadcrumb).

Any ideas?

Topics and Forum not showing when clicked on

Published on January 8th, 2024 by milimo1

I added codes on a page for my forum and included topics and a forum that displays just fine. The problem or headache starts when I click on any of the links to the shortcodes. Just a blank page is all that shows. I’ve tried searching for help but to no avail. I’ve seen in tutorials that the links shown work and lead you to more info when you click on topics or the forums. Kindly help me.

WordPress version 6.4.2, bbPress Version 2.6.9

Links to Problem Pages
Link to blank page after clicking forum
Link to forum and topics page

Hosting storage requirement?

Published on January 8th, 2024 by davout

Can somebody provide with a broad brush estimate for the storage required to have:
* 6 forums defined
* 1,000 posts within each forum – all text no images

TIA

Import Woltlap Forum Issues

Published on January 7th, 2024 by itdahdev

I took a import skript from “https://gist.github.com/ntwb/0bb069e5994c0ee8e85e”, copied the remote db to local db, setup the import panel. I works well for 33% of the import, then it stucks/hang.

Got this from WP debug:
Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in C:\htdocs\kunden\klemmer\forum\wp\wp-content\plugins\bbpress\includes\admin\parser.php:166

So i paused the import, tried to resume, then i get errors in the browser console.

Then i removed the forum data and tried to start in a incognito browser, to skip potentially problems with browser extensions. Did not help, same issues.

System: WP 6.4.2, bbPress 2.6.9, Woltlap 5.x DB content, PHP 8.2, 10.4.32-MariaDB

Would be great to get some handsome help to get this done 😉

Greets Alex

logo and widget disappear on forum page

Published on January 5th, 2024 by nickymit

Hi there

My logo and widget disappear when I go to my forum page. This makes it impossible for my users to head back to my home page from the forum page. In the sidebar where the widget is supposed to be I get this message:
There is no widget. You should add your widgets into Default sidebar area on Appearance => Widgets of your dashboard.

Page link: https://www.temp.soulistic.co.za/forum-list/
Wordpress version: 6.4.2
bbpress version: 2.6.9

Many thanks

Only allow paid users to create topic and or reply

Published on January 4th, 2024 by allyhouston

Hello,

WordPress 6.4.2, bbPress version 2.6.9, metpsy.com

I’d like to allow only paid users through MemberPress to post (and maybe to reply, though I might allow free users to reply). I would like free users to be able to view all topics though.

What is the easiest way to do this?

Very best,

Ally.

Subscriptions to topics are deleted

Published on January 4th, 2024 by andrewshu

Hi,

I found the issue with the topics subscription.
How to reproduce this issue:
1. Subscribe to the topic.
2. Go to the topic editing in the admin area and update it.
3. Check the subscription – the subscription is deleted.

Has anyone encountered this? I tested this issue on 2 installations.

Regards.

Queries regarding functionalities

Published on January 3rd, 2024 by kinsey95

Hello, I need some information regarding the plugin.
1. I want the question asked by the user will go to a moderator or moderators. The moderator will answer the question and the question and answer will both be posted upon the moderators’ approval.
In other words, no questions will be posted live until it has been explicitly approved to be live.
So how to achieve this functionality with this plugin?

2. Is there any settings that enable functionality for moderators to get email notifications for any new topic in the forum?

Skip to toolbar