Forum Replies Created
-
In reply to: bbpress link error
bbpress hates local installations
try adding
add_filter( ‘bbp_verify_nonce_request_url’, ‘my_bbp_verify_nonce_request_url’, 999, 1 );
function my_bbp_verify_nonce_request_url( $requested_url )
{
return ‘http://localhost:8888’ . $_SERVER[‘REQUEST_URI’];
}ok, I can’t immediately see an error in your coding
two thoughts
1. does professional stick – I know you don’t want to use that, but it would help show if it is the whole code or just part that is not working.
2. since lots of people copy code, it may be that your function names are not unique – eg function add_new_roles may exist elsewhere.
Try making them unique
ie change
function add_new_roles
to
function kajzh_add_new_roles
and change then filter that calls that function
add_filter( 'bbp_get_dynamic_roles', 'add_new_roles', 1 );
to
add_filter( 'bbp_get_dynamic_roles', 'kajzh_add_new_roles', 1 );
and do this for all the functions – each has a name and then a filter that calls it.
In reply to: Is there an API for bbPressAs far as I can see that is down to the rest api, not bbpress – it does the same with posts ie not show author.
I suspect barry is way ahead of me in knowledge but these two links seem to show that you write api callbacks into your website and then add them to the api
what is dashboard>settings>forums>auto role set to?
In reply to: Remove topic-author, but keep reply-authorsgreat – glad you are fixed !
In reply to: Count voice issued . Please helpthe code for if… needs two = signs so try
function none_people_discuss() { $voice_count = bbp_get_topic_voice_count(); if ( $voice_count == 1 ) echo '<span class=”no_support”>[No support]</span>'; } add_action( 'bbp_theme_before_topic_title', 'none_people_discuss' );
In reply to: Background Colorcan you post a link to your site?
In reply to: Count voice issued . Please helpthat code should put [no_support] before the topic title – is this what you are trying to achieve?
In reply to: Package installation error bbpress.2.5.12.zipno problem !!
In reply to: Can Anyone Help With This Error?yet unbelievably there seems to be no-one who has a solution after all the years of BBpress being around.
I suspect that this is because it is the symptom of many problems.
bbPress is tested with wordpress default themes. It maybe a conflict – you need to check plugins and themes
It could be a theme or plugin issue
Plugins
Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
Themes
If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.
Then come back
In reply to: Assign anonymous posts to another member?so did you change the post author in wp_posts?
In reply to: Per forum admin?2.6 alpha apparently has per forum moderation
In reply to: Package installation error bbpress.2.5.12.zipOk, then who is the culprit?
you are
go to
dashboard>plugins>add new and serach and install bbpress
In reply to: bbpress link errorbbPress is tested with wordpress default themes. It maybe a conflict – you need to check plugins and themes
It could be a theme or plugin issue
Plugins
Deactivate all but bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.
Themes
If plugins don’t pinpoint the problem, as a test switch to a default theme such as twentyfifteen, and see if this fixes.
Then come back
In reply to: Package installation error bbpress.2.5.12.zipthis is a theme not a bbpress plugin error.
that is install it as a new plugin not as a theme !
In reply to: Remove topic-author, but keep reply-authorsquickest way is to add this to your .css file
.bbp-topic-started-by { display: none; }
In reply to: Is there an API for bbPressI found that the above code took away the Forums, Topics and Replies from the dashboard in bbpress.
I found some other code and modified it as follows
/** * Add REST API support to an already registered post type. */ add_action( 'init', 'rew_custom_post_type_rest_support', 25 ); function rew_custom_post_type_rest_support() { 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'; } }
@barryhughes-1 – thoughts – can this be done better?In reply to: How to delete or empty 50000 spam replies and topics@rajaindian – I have done some coding, but do you have the ability to test this first on a test site to make sure it works?
In reply to: PHP WarningsGreat – glad you are fixed !!
In reply to: Remove “BBpress Forum” from menuI suspect it is your theme doing this, so css is probably the easy fix 🙂
In reply to: Remove topic-author, but keep reply-authorsremove topic author from what?
do you mean stop people from creating topics?
In reply to: Remove “BBpress Forum” from menuso are you now fixed?
In reply to: How to delete or empty 50000 spam replies and topicsno reply from the support site – give me a few days and I’ll see if I can find some time to look at this
In reply to: Is there an API for bbPressJust added it as a small plugin available on my site
In reply to: Is there an API for bbPress@barryhughes-1 – huge thanks – the answer is always simple once you know !
I’ve just tried
http://mysite.com/wp-json/wp/v2/topic
lists all topics
http://mysite.com/wp-json/wp/v2/forum/16316
lists forum 16316
http://mysite.com/wp-json/wp/v2/topic/?sortBy=date
lists all topics newest first