Forum Replies Created
-
we got close though !
if you do fix, come back with the solution 🙂
try re-adding my hook code as well !!
ok, let’s try something more basic
this code just replaces the bbp_get_user_favorites_link, but puts the home url as the permalink
function rew_get_user_favorites_link( $args = '', $user_id = 0, $wrap = true ) { if ( ! bbp_is_favorites_active() ) { return false; } // Parse arguments against default values $r = bbp_parse_args( $args, array( 'favorite' => __( 'Favorite', 'bbpress' ), 'favorited' => __( 'Favorited', 'bbpress' ), 'user_id' => 0, 'topic_id' => 0, 'before' => '', 'after' => '' ), 'get_user_favorites_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_fav = bbp_is_user_favorite( $user_id, $topic_id ); if ( ! empty( $is_fav ) ) { $text = $r['favorited']; $query_args = array( 'action' => 'bbp_favorite_remove', 'topic_id' => $topic_id ); } else { $text = $r['favorite']; $query_args = array( 'action' => 'bbp_favorite_add', 'topic_id' => $topic_id ); } $permalink = home_url() ; $url = esc_url( wp_nonce_url( add_query_arg( $query_args, $permalink ), 'toggle-favorite_' . $topic_id ) ); $sub = $is_fav ? ' class="is-favorite"' : ''; $html = sprintf( '%s<span id="favorite-%d" %s><a href="%s" class="favorite-toggle" data-topic="%d">%s</a></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="favorite-toggle">' . $html . '</span>'; } // Return the link return apply_filters( 'rew_get_user_favorites_link', $html, $r, $user_id, $topic_id ); }
so remove my previous suggestion, and add the above function
Then where you have
bbp_user_favorites_link($fav_args);
in your codereplace with
echo rew_get_user_favorites_link($fav_args);
In reply to: SEO Meta Description for Forums and TopicsNice plugin, just loaded it to my site 🙂
ok, I registered, but cant see where to favorite a topic??
ok, this looks like it should work – add to your functions file – try it and come back
add_action( 'bbp_favorites_handler', 'rew_redirect_to_home_page' ,10,1) ; function rew_redirect_to_home_page ($success) { if ( true === $success && is_front_page()) { $redirect = home_url() ; wp_redirect( $redirect ); // For good measure exit(); } }
hmm… dug a bit further and the problem looks more complicated than I thought – I’ll play with it and come back
In reply to: Forum first page Columnsno problem – glad you are fixed
In reply to: Manage bbpress subscriptioncan you define what makes an ‘olds subcriptions’ – ie what is the logic?
Just had a look, and it should be possible to filter that function, but I really need to use the code you are using on the homepage to understand the issue.
can you post that code?
In reply to: Create new forum errorIt could be a theme or plugin issue
Themes
As a test switch to a default theme such as twentyfifteen, and see if this fixes.
Plugins
If that deosnlt work, also 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.
Then come back
In reply to: “Invalid post type” when doing filter/searchIf you can – I’d try it with a standard theme (eg twentyxx) and no other plugins and confirm that it is a bbpress issue
In reply to: Redirect user after registrationbbpress just uses wordpress registration, so this should work for you
come back and confirm
In reply to: topic info widgetnot a simple lift of code, so I’ve created the widget in my style pack plugin.
Once activated, you’ll find the new widgets in the widgets section and can configure what they show there.
Note : these widgets only appear on the relevant pages, so you won’t see the single topic information widget unless you are in a single topic!
In reply to: topic info widgetI’m working on it – patience please
In reply to: No back button to parent forumit’ll be in one of the next 3 releases, so keep the current code, and look at the ‘what’s new’ tab on updates
In reply to: Forum first page ColumnsAlternate Forum template 1
In reply to: Forum first page Columnsonce activated go to
dashboard>settings>bbp style pack>forum templates
and select the alternate template
In reply to: topic info widgetI’ll take a look shortly
In reply to: bbpress language resetsSorry, beyond my knowledge – Milan does paid support still I think
In reply to: Removing Forums From Admin BarI suspect these are theme or another plugin related
In reply to: How to make a forum Sticky in the main Forum Pagenot totally sure what you are trying to do, but you could create a page and out the following shortcodes in it
[bbp-single-topic id=$topic_id] [bbp-forum-index]
where $topic_id is the topic you want at the top.
If you just want some basic rules, then you can create this as text and put it on a page above the
[bbp-forum-index]
In reply to: Removing Forums From Admin BarI’m not sure what you mean by ‘remove the bbPress menu from the toolbar’ – whereabouts are you seeing this and what ‘menu’ are you seeing ?
In reply to: forum moderator roledo you mean that you would like admins to see forums in the dashboard ?
In reply to: Can’t remove comments from top level forumby ‘comment’ – do you mean create topics?