@pathardepavan — post_parent is in the posts table rather than postmeta so instead of updating post meta, update the object in wp_posts. So your update callback function (update_topic_post_parent) would be something like:
function update_topic_post_parent( $value, $object, $field_name ){
$update_post_parent = array(
'ID' => (int)$object->ID, // the ID of the topic you just created
'post_parent' => (int)$value ); // whatever you want your post_parent to be as an int. You could use $field_name for 'post_parent' here but I tend to whitelist
wp_update_post( $update_post_parent )
}
and you should be able to get the post_parent from the $object directly in your get callback I think.
Also if you’re using one of the latest versions of the plugin, you should use register_rest_field as register_api_field has been deprecated.
(I’m doing this without any testing, sorry, so it might be incorrect! But I think that’s somewhere close to the answer maybe 🙂 )
Hello,
if you look at our latest topic, you will see the blue notice bar. In in, the time is formatted incorrect. There should be a comma, or even better, the word “und” between the hours and the minutes, not a full stop. I tried to change it in the translation, but there is only a code for the whole timestamp. I would suggest to update bbpress in this regard, so the timestamp becomes localizable.
Best
Manuel
so if you go in as administrator and hover over forums, you get a list of
all forums
new forums
forum moderators
or what do you get?
sorry but my test site is set up for buddypress at the mo for something else, so don’t want to alter to see what you get with just bbpress and my private groups
Do you agree with the fact that “Moderator – Cannot create and edit forums”?
Not sure I either agree or disagree, or that it is a fact – I’m trying to help here, I’m not trying win an argument in a bar, but as a user of this software I haven’t tested every feature 🙂
The documentation for bbpress says that moderators can publish and edit forums
https://codex.bbpress.org/getting-started/before-installing/bbpress-user-roles-and-capabilities/
Is it this that you are asserting isn’t true?
Okay I tested the bbPress forum search on my localhost setup with the latest bbPress, BuddyPress, and WordPress, and I have no issues.
I am running a default setup, and I do not have the forums under a directory called “members area” though. If you run bbPress in the default setup without putting it under the “members area” directory would it work on your site if you searched “forum” for your only forum on your site?
I am not entirely sure how you did the members area directory on your site in the first place, I am not entirely sure it is a sub directory in a multisite setup.
@pestocat for the latest bbPress v2 plugin, you need to install the Akismet plugin from wordpress.org.
Hello,
I tried to use this code to remove the little character between the Subscribe and Favorite link, but it does not seem to work.
/*Fix character issue with BBPress admin links menu*/
function hide_before2 ($args = array() ) {
$args['before'] = ' ';
$args['subscribe'] = 'Subscribe';
$args['unsubscribe'] = 'Unsubscribe';
return $args;
}
add_filter('bbp_before_get_user_subscribe_link_parse_args', 'hide_before2');
http://yourtechadvisors.com/forums/topic/testing/
Feel free to create an account, I think the biggest problem is the Subscribe/Unsubscribe link that can be found under the Options menu. Please check screenshot.
https://drive.google.com/file/d/0B_h6oU4LzDtlYU44LUNCQVNaZ0U/view?usp=sharing
Any suggestions?
Hello there,
I have a really strange problem… In the last few days I’ve noticed that all my messages do not show paragraphs, bolds, italics and neither links inside my topics.
I find it really strange and if you want to have a look to this is the link on a page where this happens. Inside this response there was some links and formatting but everything is gone.
It seems like WordPress is stripping out all the formatting my users add to the text and if you inspect the code you’ll find out that not a single <p> has been used…
I am using custom template pages but in order to test I’ve also renamed the bbpress/ folder inside my theme and the problem is still present. Tryed to use Twenty Fiftheen and the problem persists. Also checked the settings but everything seems normal.
The only thing I’ve done is update WordPress to the version 4.5, at least is the last action that I can recall.
Hope you can help me and thank you for your advices.
All the best,
Andrea
WordPress Version: 4.5
bbPress Version: 2.5.8
Genesis Version: 2.2.7
bbPress Genesis Extend Version: 1.1.1
Hello all
i am using wordpress latest,
bbpress latest
theme
and only active 2 plugin as localhost forum and subforum 77
topics 514
reply 2729
i had used
Debug Bar && Debug Bar bbPress
Query Monitor && Query Monitor bbPress & BuddyPress Conditionals
and it’s show the query when the new topic page loading.
in /includes/topics/functions.php
every thing prossess smothly in this file til
/** Update counts, etc… *********************************************/
//exit();
do_action( ‘bbp_new_topic’, $topic_id, $forum_id, $anonymous_data, $topic_author );
here every thing work so so long
just to be more detailed i had read allot about wp_insert_post if inserting allot of topics in the same time but, now i am in local and only me posting in topics
what i am missing here and from where to look in
thanks in advance
regards
Hi,
I would say find the ‘content-single-forum.php’ file and edit it. You will probably see twice a line with <?php bbp_get_template_part( 'pagination', 'topics' ); ?> , so you need to delete the first one to hide the top pagination.
I didn’t test it, just guessing from what I read.
Pascal.
Had a chance to test this out locally. The URL re-writes work like a charm, without any conflicts.
@siparker @netweb The plugin works almost perfectly, BUT there is still one big issue — by adding -postIDs to the end of Forum and Category URLs (mysite.com/forums/category-name-postIDstring) or (mysite.com/forums/category-name/forum-name-postIDstring), we’ve defeated the SEO purpose of re-writing these URLs.
For authority to be passed allll the way down to the topics, we need for the forums and categories’ permalinks to live without these -postIDs. That way, (mysite.com/forums/category-name/forum-name/topic-name-postIDstring) can get the full trickle down benefit from any links /category-name/ and /forum-name/ receive.
I’m going to play around with the plugin code to see if I can just rip the right bit out! Thanks again!
EDIT: So removing .'-f' .$post->ID from lines 50 and 60 fixed the URLs in the CMS BUT broke the page. It seems like the plugin relies on the postIDs to associate the new URLs with the old URL structure? If so, how can we achieve this without actually using the postID in the URL?
@siparker you are a godsend! I’ll have to test this tonight, but I’m hoping to be one of the first new bbPress forums to proudly be using pretty, SEO-friendly permalinks. Thank you!!
Thank you for your response, Samuel! I will let you know how it goes as soon as I can test it out. Didn’t want to think I was ignoring you.
Hi,
I have no clue what this could be… maybe another (not really bbPress related) plugin ?
You tested this both as admin and as participant ?
Pascal.
Hello,
I have made this a little simple, where any visitor can have an overlay division hiding the topic content and everything when there are caught words in the currently viewing topic..
You can add this code to your theme’s functions file:
Remember: edit $list = 'test,bad topic,'; line to insert your watched words separated by commas without a space after the commas.
add_action('wp', function() {
/**
* Add the watched words or sentences separated by commas.
* Remember not to add a space before the words
* Example : 'evil dog,naughty cat,pig'
*/
$list = 'test,bad topic,';
// set up a global variable for our case
$GLOBALS['my_filtered_words'] = explode(',', $list);
});
add_action('bbp_theme_after_reply_content', function() {
if( ! get_the_ID() )
return;
$topic = get_post( get_the_ID() );
if( ! $topic || 'topic' !== $topic->post_type )
return;
global $my_filtered_words;
$words = preg_split( "/\s+/", $topic->post_content );
foreach( $words as $i => $word )
$words[$i] = strtolower($word);
$occurance = 0;
foreach( $my_filtered_words as $string ) {
$string = strtolower( $string );
$occurance += in_array( $string, $words ) ? 1 : 0;
}
if( ! ( $occurance > 0 ) )
return; // nothing caught
$cookie = isset( $_COOKIE['se_conf_warned_topics'] ) ? explode(',', $_COOKIE['se_conf_warned_topics']) : array();
if( in_array($topic->ID, $cookie) )
return; // confirmed before.
?>
<style type="text/css">
.se-conf-wt {position: fixed; top: 0; left: 0; background: rgba(0, 0, 0, 0.78); width: 100%; height: 100%; z-index: 999;}
.se-conf-wt p {color: #fff; position: relative; top: 50%; display: table;margin: 0 auto;}
.se-conf-wt a {color:#fff;}
</style>
<div class="se-conf-wt t-<?php echo $topic->ID; ?>">
<p>This topic contains offensive content. <a href="javascript:;">Continue?</a></p>
</div>
<script type="text/javascript">
window.onload = function() {
var a = document.querySelector('.se-conf-wt.t-<?php echo $topic->ID; ?> a'),
b = document.body;
a.onclick = function() {
var expires = new Date(),
cval = '<?php echo isset($_COOKIE['se_conf_warned_topics']) ? $_COOKIE['se_conf_warned_topics'] : ''; ?>';
expires.setMonth(expires.getMonth() + 6); // 6 months expiracy date
cval += '<?php echo $topic->ID; ?>,';
document.cookie = "se_conf_warned_topics=" + cval + "; expires=" + expires;
// cookie set, now let's hide the warning
this.parentNode.parentNode.remove();
b.style.overflowY = '';
return false;
}
b.style.overflowY = 'hidden';
}
</script>
<?php
});
Tested on my local installation and it works fine.
Let me know how it goes.
Samuel
Hello, here are the steps for you:
1. Create a ‘new topic’ page at example.com/new-topic/ and add [bbp-topic-form] shortcode as content.
2. Add this code to your child theme’s functions file:
add_filter('the_content', function($content) {
global $post;
if( 'post' == $post->post_type && is_user_logged_in() ) {
$content .= '<p><a href="' . home_url('new-topic/?se_pid=' . $post->ID) . '">Generate a topic</a></p>';
}
return $content;
});
add_action('init', function() {
$content = null;
if( isset( $_GET['se_pid'] ) ) {
$pid = (int) $_GET['se_pid'];
$content = get_post( $pid );
}
$GLOBALS['se_post'] = $content;
});
add_filter('bbp_get_form_topic_title', function( $title ) {
global $se_post;
if( $se_post ) {
return $se_post->post_title;
}
return $title;
});
add_filter('bbp_get_form_topic_content', function( $body ) {
global $se_post;
if( $se_post ) {
return $se_post->post_content;
}
return $body;
});
Test it out, go to your posts and scroll down to the bottom, click the “generate ..” link and see if it worked.
I am here for any further customization or if you encounter issues with implementing this.
Regars,
Samuel
I would like to prepare some blog posts ahead of the time when they should be seen. How can I do that?
Today, I tried to create one thread with the status “pending” but it didn’t display the content, while still keeping the subject. When I rewrote the post, it is now showing for me (admin) but non-admin get a 404 error if they click on the subject. That topic is about a contest that will only start next Friday, so I don’t want to show it yet, but I can’t even hide the topic either so members are trying to see what it is all about.
Is there a way to hide a thread completely? If so, how?
I have WP 4.5 and bbpress 2.5.8
Thanks
I am using WordPress 4.5 and bbPress 2.5.8.
I have tested the following on both Chrome and FireFox, in both normal and incognito modes.
The issue persists when using the Twenty … themes.
The issue also persists when turning off all extra bbPress plugins.
The issue is also present in bbPress 2.6-alpha.
The rest of my site works normally.
@thebrandonallen You’re right. I made a mistake when doing these tests.
Here’s the results when I keep only the essential extensions, but without bbPress:
WordPress Plugin Profile Report
===========================================
Report date: 14 avril 2016
Theme name: FQSA
Pages browsed: 13
Avg. load time: 1.4570 sec
Number of plugins: 6
Plugin impact: 80.34% of load time
Avg. plugin time: 1.1705 sec
Avg. core time: 0.2184 sec
Avg. theme time: 0.0286 sec
Avg. mem usage: 142.06 MB
Avg. ticks: 189,088
Avg. db queries : 57.92
Margin of error : 0.0394 sec
Plugin list:
===========================================
P3 (Plugin Performance Profiler) – 0.0039 sec – 0.34%
Query Monitor – 0.0140 sec – 1.20%
Maintenance – 0.0040 sec – 0.35%
WooCommerce Memberships – 0.0311 sec – 2.66%
WooCommerce Subscriptions – 1.0300 sec – 87.99%
WooCommerce – 0.0874 sec – 7.47%
Here’s the results when bbpress is activated:
WordPress Plugin Profile Report
===========================================
Report date: 14 avril 2016
Theme name: FQSA
Pages browsed: 11
Avg. load time: 4.8047 sec
Number of plugins: 7
Plugin impact: 93.15% of load time
Avg. plugin time: 4.4756 sec
Avg. core time: 0.2278 sec
Avg. theme time: 0.0339 sec
Avg. mem usage: 210.25 MB
Avg. ticks: 289,193
Avg. db queries : 126.36
Margin of error : 0.0673 sec
Plugin list:
===========================================
P3 (Plugin Performance Profiler) – 0.0038 sec – 0.08%
Query Monitor – 0.0146 sec – 0.33%
bbPress – 0.0824 sec – 1.84%
Maintenance – 0.0040 sec – 0.09%
WooCommerce Memberships – 0.0421 sec – 0.94%
WooCommerce Subscriptions – 4.2424 sec – 94.79%
WooCommerce – 0.0864 sec – 1.93%
You can see, in fact, that Subscriptions seems to be the problem… I don’t really know because all these plugins seems to be connected a lot.
It might be your theme too is causing you issues with 4.5
The only way to find out is to switch to a default theme like Twenty Fifteen, deactivate all plugins except bbPress and start testing from there.
When you found what is blocking, open support requests for the theme/plugin. But I confirm that on bbPress side all seems working great with 4.5.
Sorry I can’t further help you, but if you find the issue, please post it back here.
Pascal.
Pascal, thanks for getting back to me. I’m currently using the Customizr theme updated to the latest version. I had a look at the forum on my iPhone and like you said it looks even worse!! In relation to your patch where should I enter this into?
Hi there,
I am currently working on my first bbPress site and thoroughly enjoying it! I have one issue though…
On my home page I have a list of 8 latest posts on the site. They include news (standard WP posts), events (custom post type) and bbPress topics and are displayed with query_posts().
I am trying to display the reply count of topics but can’t using bbp_topic_reply_count(), it simply returns 0.
<?php if ( 'topic' == get_post_type() ) : ?>
<article class="bit-4 newsPost grid-sizer grid-item">
<div class="eventInner homePost">
<p class="postLabel">Discussion</p>
<h1 class="eventListTitle"><a href="<?php the_permalink(); ?> "><?php the_title(); ?></a></h1>
<p class="postedOn"><?php bbp_topic_reply_count(); ?> comments, starting on<?php the_date('d M Y'); ?></p>
<p><?php echo get_excerpt(); ?></p>
</div>
</article>
<?php endif; ?>
Am I missing something? Can someone help please?
Thanks
Hello,
i am useing:
Wordpress latest
bbpress latest
using only 1 plugin GD bbPress Tools latest
when visit forum -> topic then i Subscribe
forum -> topic -> post reply
case i lose the subscibe
@sidebarissue
The bbPress sidebar that you see having the issue, is from your theme. bbPress does not have code in it for a bbPress specific sidebar.
You haven’t checked and made sure to see if it was in your theme by switching/testing a default theme.
I still haven’t tried switching to the twentytwelve theme because I don’t want to lose all of my settings for my current theme.
You can try your current theme and a WordPress default theme in a local installation on your cpu to see where the sidebar is coming from.
https://codex.bbpress.org/getting-started/testing-your-bbpress-installation/creating-a-test-site/#local-installation
Hello all,
i am using wordpress latest
bbpress latest
my problem with bbpress plugin root\extend\buddypress\notifications.php i am tring to get to last reply url or the posted reply url.
Regards