Search Results for 'bbpress'
-
Search Results
-
Topic: Attached Image
Hi,
I just want to ask if there’s a php code or bbpress codex or hooks that can help me in adding an upload media or attached image in the bbp_the_content?
I really don’t want to use plugin for this feature.Thanks. I am hoping for your kind response soon.
Hello,
I would like to know the correct method to add a filter in a child theme for a template function.
For this example lets use ‘bbp_get_user_subscribe_link()’
I would like to insert
<icon class="icon-user"></i>
into the following before the %s
<span id="subscribe-%d" %s>%s
$html = sprintf( '%s<span id="subscribe-%d" %s>%s</span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] );
of this function bbp_get_user_subscribe_link()
function bbp_get_user_subscribe_link( $args = '', $user_id = 0, $wrap = true ) { if ( !bbp_is_subscriptions_active() ) return; // Parse arguments against default values $r = bbp_parse_args( $args, array( 'subscribe' => __( 'Subscribe', 'bbpress' ), 'unsubscribe' => __( 'Unsubscribe', 'bbpress' ), 'user_id' => 0, 'topic_id' => 0, 'before' => ' | ', 'after' => '' ), 'get_user_subscribe_link' ); // Validate user and topic ID's $user_id = bbp_get_user_id( $r['user_id'], true, true ); $topic_id = bbp_get_topic_id( $r['topic_id'] ); if ( empty( $user_id ) || empty( $topic_id ) ) { return false; } // No link if you can't edit yourself if ( !current_user_can( 'edit_user', (int) $user_id ) ) { return false; } // Decide which link to show $is_subscribed = bbp_is_user_subscribed( $user_id, $topic_id ); if ( !empty( $is_subscribed ) ) { $text = $r['unsubscribe']; $query_args = array( 'action' => 'bbp_unsubscribe', 'topic_id' => $topic_id ); } else { $text = $r['subscribe']; $query_args = array( 'action' => 'bbp_subscribe', 'topic_id' => $topic_id ); } // Create the link based where the user is and if the user is // subscribed already if ( bbp_is_subscriptions() ) { $permalink = bbp_get_subscriptions_permalink( $user_id ); } elseif ( bbp_is_single_topic() || bbp_is_single_reply() ) { $permalink = bbp_get_topic_permalink( $topic_id ); } else { $permalink = get_permalink(); } $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-subscription_' . $topic_id ) ); $sub = $is_subscribed ? ' class="is-subscribed"' : ''; $html = sprintf( '%s<span id="subscribe-%d" %s>%s</span>%s', $r['before'], $topic_id, $sub, $url, $topic_id, $text, $r['after'] ); // Initial output is wrapped in a span, ajax output is hooked to this if ( !empty( $wrap ) ) { $html = '<span id="subscription-toggle">' . $html . '</span>'; } // Return the link return apply_filters( 'bbp_get_user_subscribe_link', $html, $r, $user_id, $topic_id ); }So how would I construct my_custom_bbp_get_user_subscribe_link() function to add_filter( ‘bbp_get_user_subscribe_link’, ‘my_custom_bbp_get_user_subscribe_link’ ); ?
I hope the answer will serve as a general example to correctly add filters to many other template functions.
Thanks for your assistance.
Hi! I noticed that BBPress profile does not include several fields of the core WordPress profile. Is there any way to include them? It is very important for my website, because others plugins need those fields to work properly. Notice that I don´t need to create “custom fields”, but to include the core WordPress fields.
Topic: Force Login to View
On bbPress 1.x they had a plugin that forced login to view any pages within the forum, not just making the private once you’re on the forums.
Anything like this for bbPress 2?
Topic: Translation not shown
Hi,
I’ve installed bbPress 2.4.1 and I’ve the language files on:
wp-content/languages/plugins
bbpress-es_ES.mo
bbpress-es_ES.poI’ve also the correct configuration at wp-config.php:
define(‘WPLANG’, ‘es_ES’);The problem is that bbPress is showing the messages in english and not in spanish as I want.
What I’m doing wrong?
Any help will be appreciated.Thanks,
JavierGreetings all,
I am not sure even if it is possible, but I thought I seen that one could use an importer from phpbb to bbpress. Right now I use the wp-united but it seems that things are not being kept up. So am considering the transition. Is there such an importer? Stephen @netweb maybe you could help me with this? Or anyone in that matter. Part of my site is:
JosephStory Support GroupWill this be a difficult transition? Will I loose a lot?
Thanks to everyone willing to help and inform.
Joseph