Search Results for 'code'
-
Search Results
-
Hi!
I tried a snippet from this page: https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/#24-show-status-labels-for-bbpress-topics
to get a label or icon for sticky topics.function rk_sticky_topics() { if ( bbp_is_topic_sticky() && !bbp_is_topic_closed() ) echo '<span class="sticky">[Sticky]</span>'; } add_action( 'bbp_theme_before_topic_title', 'rk_sticky_topics' );
I get a fatal error with syntax error unexpected ‘;’ on the line starting with if.
Thank you in advance
Topic: Template in Block Themes?
BBpress keeps loading the empty index.php in the TwentyTwentyTwo Child theme I’m working on, which loads a WSOD.
I can’t get any of the template filters to use one of the html files, so temporarily have it working with the index.php file as:
wp_head(); block_header_area(); block_template_part( 'page-inner' ); wp_footer(); block_footer_area();
And… its almost all working? But, this can’t be the right way to get it to use the new default page template in the block theme.
Thoughts? Ideas? How can I get it to use the new theme templates?
Thanks!
Hi there,
I’m trying to find a solution to the problem of participants being able to remove single topic tags by simply removing them from the “Tags” input field on the reply-to form.
I’ve found this thread that clearly explains the issue
and offers a solution that is unfortunately not working on my end.My form-reply.php currently has this line:
<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() )) : ?>
which I tried to replace with:
<?php if ( bbp_allow_topic_tags() && current_user_can( 'assign_topic_tags', bbp_get_topic_id() ) && current_user_can('moderate') ) : ?>
to no avail.Has anyone solved this issue? Would love some guidance here! 🙂
Is there a way to redirect all profile page links so they use the user id, instead of user login/nicename? Some users have their email as their username, so we want to hide it.
So to go from
/forums/users/{login}to
/forums/users/{id}I was able to change the URLs so they point to the right place:
function bbp_custom_author_link( $url, $user_id, $user_nicename){ $url = site_url()."/forums/users/".$user_id; return $url; } add_filter( 'bbp_get_user_profile_url', 'bbp_custom_author_link', 10, 3);
But once you click on the link, you end up in a 404.
Hi,
I’m trying to customise the toolbar in TinyMCE.Initially I just enabled the advanced one:
function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = true; $args['teeny'] = false; $args['quicktags'] = false; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
I thought of adding a button for underline and it led to trying to get only what I needed in one toolbar:
function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = array('toolbar1' => 'formatselect, bold, italic, underline, bullist, numlist, blockquote, alignleft, aligncenter, alignright, link, strikethrough, forecolor, outdent, indent, undo, redo'); $args['quicktags'] = false; $args['teeny'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );
This is causing it to repeat some things in toolbar 2 (as well as the ability to toggle toolbar 2 on and off). I tried adding toolbar 2 to the code above, but then it goes back to default. I could stop there though and just add underline and the tools that’s in toolbar 1 by default, but I’m curious if I can customise things further.
To my question:
Is there a way to add everything in one toolbar and then disable toolbar 2?
Or is there a way to get the toogle for toolbar 2 back when I’ve customised toolbar 1?I also tried enabling teeny which would’ve worked best, but then I lose the forecolor toolbar box so I’d need a way to add it back.
Thanks in advance