There are many plugins to allow approve a new user by moderator.
But, Is there a simple solution to do the same by editing function.php? Without new plugin?
Thank you in advance
I have you eminent plug in and love it already 🙂 And already checked the shortcodes there. However there is only a shortcode to add a button/text to press that links to the profile. I would love a shortcode as the [bbp-forum-index] but for example [bbp-forum-profile]. Cant find any but maybe there is non?
bbp style pack
once activated go to
dashboard>settings>bbp style pack>shortcodes
How come I cant find a shortcode for the bbpress user profile?
This is the plugin for using shortcodes in menu – hope this helps ?
Shortcode in Menus
Thanks for your quick answer!
That shows the text ‘my profile’ and when you click on it, you go to your profile.
Screenshot: https://prnt.sc/zpyin3
The profile URL = https://despelletjesvrienden.nl/forums/users/xxx (xxx = username) so I can’t use that URL.
Could you tell me: how can I add a shortcode to the menu? Since it’s not an URL.
(I still prefer to put the profile in my other page as a part of the page.)
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
function change_reply_order() {
$args['order'] = 'DESC';
return $args;
}
add_filter('bbp_before_has_replies_parse_args', 'change_reply_order');
Does the [bsp-profile] shortcode not work if placed upon a page and is already logged in ?
I am using the [bsp-profile] shortcode via a menu option, as simpler for users to see and use and can be hidden if user is not logged in etc ?
Is there a shortcode that show the profile instead of linking to the profile?
A shortcode that I can add to a page, so viewers can go to that page and view their profile?
I added [bsp-profile label=’Bekijk mijn profiel’] to this page but I would like to just show the profile on this page because the url/shortcode looks kinda hidden.
Forum dashboard
(I googled a lot to fix this but this topic was the best I could find so far.)
Hi there,
I’m trying to work out what’s actually going on here.
Whenever any person (including myself as keymaster) inserts a link, it is stripped from the post when it gets displayed. All othe formatting seems to make it through.
I have added the following code to the theme’s functions.php to try and enable this functionality:
add_action( 'bbp_kses_allowed_tags','pyg_kses_allowed_tags',999,1);
function pyg_kses_allowed_tags($input){
return array(
// paragraphs
'p' => array(
'style' => array()
),
'span' => array(
'style' => array()
),
// Links
'a' => array(
'href' => array(),
'title' => array(),
'rel' => array()
),
// Quotes
'blockquote' => array(
'cite' => array()
),
// Code
'code' => array(),
'pre' => array(),
// Formatting
'em' => array(),
'strong' => array(),
'del' => array(
'datetime' => true,
),
// Lists
'ul' => array(),
'ol' => array(
'start' => true,
),
'li' => array(),
// Images
'img' => array(
'src' => true,
'border' => true,
'alt' => true,
'height' => true,
'width' => true,
)
);
}
I have tried to find other documentation to try and work out why this is occurring and have drawn a blank. Anybody have any other suggestions?
Hi
I use wordpress + bbpress
For example, i need to write a query statement(mysql) on a topic.
ex)
select
id,
numberfrom tab
When an grave accent is entered, the [code] tag is automatically inserted.
ref img : https://ibb.co/9bhG177
I want it to be typed exactly as you type it.
So I want to disable the function for the code tag.
I need your help and support
Best Regards,
Hyunho
put this in your custom css to remove the background
.bbp-author-link {
background: none !important;
}
@newest the issue relates to how gutenberg does an update – it uses AJAX rather than refresh the post, so the initial settings are not seen, and the post considers the update as a new publish.
I’ll need to work on some code to fix
great, and yes please post the completed functioning code once you have got it working !!
I set $forum_id = bbp_get_forum_id() ;
and change these two
if (!empty ($prev_id) && wp_get_post_parent_id($prev_id) == $forum_id) {
and
if (!empty ($next_id) && wp_get_post_parent_id($next_id) == $forum_id) {
Notice the equal sign, that solved the problem!
Thank you so much Robin!
EDIT:
The last topic links in every forum somehow get left behind, only the last ones.. I’ll tinker around and post my findings
hmmm…not sure about the ‘leak in’ bit, how are lines being displayed if $prev etc. is blank?
you could add a check
so set
$forum_id = bbp_get_forum_id() ;
above the while statement and then check at the appropriate point
if (wp_get_post_parent_id($prev_id) != $forum_id) {
etc.
}
Thank you Robin,
I tried this, I was inserting this in single-topic.php so I was not sure which one would work.
$topic_id = bbp_get_topic_id() ;
works well, the only issue is that once it nears the end, the other forums start leaking in, if prev or next is empty they leak in
Otherwise it’s working as expected, also I fixed if ($cur == $topic_id) {
to if ($cur_id == $topic_id) {
just had a quick look
this should get you close, totally untested !!
<?php $args = array( 'post_type' => 'topic', 'post_parent' => bbp_get_forum_id() );
$loop = new WP_Query( $args );
//get the current topic id or maybe depending in where you are putting this - bbp_get_reply_topic_id or bbp_get_reply_id()
$topic_id = bbp_get_topic_id() ;
while ( $loop->have_posts() ) : $loop->the_post();
$cur_id = get_the_ID();
if ($cur == $topic_id) {
$prev = get_previous_post() ;
$prev_id = $prev->ID ;
$next = get_next_post();
$next_id = $next->ID ;
break ;
}
endwhile;
//so you now have $cur_id, $prev_id and $next_id
//so create 3 lines
if (!empty ($prev_id)) {
$permalink = get_permalink($prev_id) ;
$title = get_the_title ($prev_id) ;
echo '<a href="'.$permalink.'">'.$title.'</a>' ;
}
if (!empty ($cur_id)) {
$permalink = get_permalink($cur_id) ;
$title = get_the_title ($cur_id) ;
echo '<a href="'.$permalink.'">'.$title.'</a>' ;
}
if (!empty ($next_id)) {
$permalink = get_permalink($next_id) ;
$title = get_the_title ($next_id) ;
echo '<a href="'.$permalink.'">'.$title.'</a>' ;
}
?>
solution is
.single-forum .post-navigation .nav-links {
display: none !important;
}
.single-topic .post-navigation .nav-links {
display: none;
}
Update Feb 11, 2021.
Having looked at this more thoroughly it looks like what has happened is that most of my replies have been treated as separate topics by the importer. Having had a deeper look between the replies that were imported properly and those that ended up in separate topics, it is likely related to the fact that all of my replies had been submitted by a form. These replies were then manually moved into the appropriate thread, however because of this, there is no value in the replyto column of the posts table. I believe that the converter relies on this relationship to combine replies in the same topic as opposed to relying on the tid column.
I am working my way through the converter code to see if I can identify the function that establishes this relationship with hopes of updating it to work. Alternatively I may have to manually update the post table in MyBB prior to import to establish this relationship.
I made the list
<?php $args = array( 'post_type' => 'topic', 'post_parent' => bbp_get_forum_id() ); $loop = new WP_Query( $args ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php echo get_the_permalink(); ?>"><?php the_title(); ?></a>
<?php endwhile;?>
This gives me all the topics under the current topic’s forum (I’m on single-topic.php)
Is there a way I could limit the list to 5 links (that’s easy, post_per_page = 5
) but on top of that only show the adjacent posts?
Topic 3 link
Topic 4 link
Topic 5 link <----- I'm here
Topic 6 link
Topic 7 link
In the above example, it’s showing me 2 previous adjacent posts and to next adjacent posts
What happens is if I set post_per_page
to 5 then this happens
Topic 1 link
Topic 2 link
Topic 3 link
Topic 4 link
Topic 5 link <----- I'm here
The current link is always last, I realized this is more of a wordpress question but I’d like to try my luck here since I already opened a thread
there are filters for topics and replies
bbpress 2.6.6\includes\topics\functions.php lines 389 and 705
$redirect_url = apply_filters( 'bbp_new_topic_redirect_to', $redirect_url, $redirect_to, $topic_id );
$topic_url = apply_filters( 'bbp_edit_topic_redirect_to', $topic_url, $view_all, $redirect_to );
bbpress 2.6.6\includes\replies\functions.php lines 473 and 768
$reply_url = apply_filters( 'bbp_new_reply_redirect_to', $reply_url, $redirect_to, $reply_id );
$reply_url = apply_filters( 'bbp_edit_reply_redirect_to', $reply_url, $redirect_to );
which Weglot can apply query args to
ok, hard to help without a link – a bit like trying to fix a car by email 🙂
try
#bbpress .post-navigation {
display : none !important ;
}
add this to your theme’s custom css
Hi Robin,
Forum is logged-in users only 🙁
Theme is Astra.
Maybe the code is helpful?
Code from the Forum-Next-Link:
<nav class=”navigation post-navigation” role=”navigation” aria-label=”Messages”>
<h2 class=”screen-reader-text”>Navigation</h2>
<div class=”nav-links”><div class=”nav-next”>Next Forum<span class=”ast-right-arrow”>→</span></div></div>
</nav> </main><!– #main –>
Code from the Topic-Next-Link:
<nav class=”navigation post-navigation” role=”navigation” aria-label=”Messages”>
<h2 class=”screen-reader-text”>Navigation</h2>
<div class=”nav-links”><div class=”nav-next”>” rel=”next”>Next Subject <span class=”ast-right-arrow”>→</span></div></div>
</nav> </main><!– #main –>
Oh my! Many thanks uksentinel! That worked for taking away the search bar above the forum and keeping the sidebar.
Offtopic/sidenote: for every thing I do on my page I feel really proud of my self. Never knew I could even get a site up and running. Now I am doing code (however with extremely good guides from you guys ofc!) and I feel amazing 🙂 Thank you for helping out!