Search Results for 'code'
-
AuthorSearch Results
-
January 30, 2023 at 10:34 pm #234099
Topic: Post Meta for Current Users Topics Page
in forum Troubleshootinganthvale
ParticipantLooking for a line of code or a post meta field name to retrieve a link for the current user’s topics page. Is this something you can help me with?
January 29, 2023 at 2:12 pm #234081In reply to: TwentTwentyThree – Views
Robin W
Moderatorso if you remove the code that you had and just use the plugin, does this fix?
January 27, 2023 at 3:57 am #234055In reply to: Help with installation
January 27, 2023 at 1:36 am #234053In reply to: Change “Posts” to “Replies” in topic header
enkoes
ParticipantHi Robin, after spent some time trying to understand the codes, I tried and finally got the results that I wanted.
For loop-topics.php,
I change:<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? esc_html_e( 'Replies', 'bbpress' ) : esc_html_e( 'Posts', 'bbpress' ); ?></li>
to:
<li class="bbp-topic-reply-count"><?php esc_html_e( 'Replies', 'bbpress' ); ?></li>
and for loop-single-topic.php,
I change:
<li class="bbp-topic-reply-count"><?php bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count(); ?></li>
to:
<li class="bbp-topic-reply-count"><?php bbp_topic_reply_count(); ?></li>
Since I don’t have any knowledge about PHP codes, I’m not sure what I did is correct or not, anyway at least work on my browser.
Regards
January 25, 2023 at 3:29 am #234030In reply to: Change “Posts” to “Replies” in topic header
Robin W
Moderatorlets you style your forums
you can also use the translations tab of this to change Posts to Replies
there is also
which contains styling guides
January 25, 2023 at 3:29 am #234031In reply to: Change “Posts” to “Replies” in topic header
Robin W
Moderatorlets you style your forums
you can also use the translations tab of this to change Posts to Replies
there is also
which contains styling guides
January 24, 2023 at 5:14 am #234004In reply to: Roles and Capabilities in bbPress 2.2
Ludovic S. Clain
ParticipantHey ๐ย
Thank you @Robin-W,
In the meantime I got to know the WP-Cli-Cli package specific to WordPress, which does not work either (I opened an issue visible here).To locate the context, I use WooCommerce Subscription plugin and I needed that when a subscription is canceled, access to the bbPress forum is blocked.
I leave here the snippet that I made and that does the job:
add_action('woocommerce_subscription_status_cancelled', 'block_forum_user_after_subscription_cancellation_s', 10, 1); function block_forum_user_after_subscription_cancellation_s($subscription) { $user_id = $subscription->get_user_id(); $new_role = 'bbp_blocked'; bbp_set_user_role($user_id, $new_role); }
(I also have a webhook version with the WordPress Rest API for remote use, if necessary contact me)
January 23, 2023 at 11:41 am #234000In reply to: Roles and Capabilities in bbPress 2.2
Robin W
Moderatorbbp_set_user_role( $user_id, $new_role )
January 23, 2023 at 10:26 am #233997In reply to: Roles and Capabilities in bbPress 2.2
Ludovic S. Clain
ParticipantHi there ๐ย
Thanks to the details of @stanis I am understanding why when I use WP-Cli with the line:
wp user set-role <User id> bbp_blocked
It blows up the existing role of the User on WordPress (in my case it was “customer” which becomes ” – no role for this site -“)
But it’s still unclear for me. How to modify the role of an User on BBPPRESS without touching its WordPress role?
Because the opposite is also true, if I do :
wp user set-role <User ID> customer
This time it is the role of the User on the forum that jumps and becomes “-No Role for these forums-”
PS: I also tried
wp user update <User ID> --role=customer --bbp-forums-role=bbp_blocked
And that doesn’t do the job too ๐Thanks for your lights!
Warm regards,
LudovicJanuary 21, 2023 at 7:32 pm #233962In reply to: User email management
timholland
ParticipantHi Robin,
I looked at the forum screens and there is a button for adding a forum to a digest. I clicked it and it changed to give me the option to remove it from the digest.
A second link is there for editing digest settings, however when I click it, I get:
Page Not Found
The page you were looking for could not be found. It might have been removed, renamed, or did not exist in the first place.The link is https://somd-scalemodelers.club/members/timh/edit/#bbp-digest-check-row
And if I understand correctly, thatโs a function in the bbpress digest plugin php code.
Any ideas where I should look next?
Regards,
TimJanuary 20, 2023 at 4:46 am #233937In reply to: Archives:Forums
Robin W
ModeratorTry this
add_filter( 'get_the_archive_title', 'to_archive_title_remove_prefix' ); function to_archive_title_remove_prefix( $title ) { if ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } return $title; }
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
January 18, 2023 at 2:46 pm #233915In reply to: Limit replies per day per user?
Robin W
Moderator1. only replies
2. bespoke code neededJanuary 15, 2023 at 4:44 am #233842In reply to: hiding some items in forum & topic page
Robin W
Moderator2nd – works in my browser for your site – can you close and reopen and check again, or post a new image showing what is still wrong, and links to an exact example.
3rd – I don’t know what ‘no output results’ means ??? again it seems to have gone from your site in my browser.
I did see that I had not taken out the ‘author/posts’ from the footer – you can add this
.forums.bbp-replies li.bbp-footer { display: none; }
January 14, 2023 at 3:29 pm #233839In reply to: Custom Profile Fields
scottmotion
ParticipantFirst you could try Robin’s bbPress plugin: https://wordpress.org/plugins/bbp-profile-information/
Same with BuddyPress integration: https://wordpress.org/plugins/bbp-buddypress-profile-information/If you’re not using BuddyPress though I would highly recommend looking into it. You can enable “Extended Profile Fields” and there’s also a plugin for custom field types: https://wordpress.org/plugins/bp-xprofile-custom-field-types/
As far as the outbound links themselves go you might need to code/style them yourself unless your theme automatically converts links.
January 14, 2023 at 2:19 pm #233838In reply to: Function to return all replies to a topic
Robin W
Moderatormy code above corrected works, but yes do come back and let us know if you find the problem or need further help
January 14, 2023 at 1:54 pm #233837In reply to: Function to return all replies to a topic
saciojote
ParticipantYes I did I noticed that before I tried the code. I will play around and see if I can find the problem, if the
get_page_by_title()
works as I would like then it must be an error somewhere else.Thank you for your help!
January 14, 2023 at 12:18 pm #233835In reply to: hiding some items in forum & topic page
Robin W
Moderatorput this in the custom css of you theme
div.bbp-template-notice.info { display: none; } .bbp-pagination-count { display: none; } .forums.bbp-replies li.bbp-header { display: none; }
January 13, 2023 at 6:35 pm #233827In reply to: Customizing the bbPress login page
Robin W
Moderatorok, based on that I have no idea what you mean by embedding.
bbpress does not have a ‘login page’ it has shortcodes and widgets.
the template used by bbpress for login is
bbpress\templates\default\bbpress\form-user-login.php
to customise :
find
wp-content/plugins/bbpress/templates/default/bbpress/form-user-login.phptransfer this to your pc and edit as desired
and save
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpresswhere %your-theme-name% is the name of your theme
Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/form-user-login.phpbbPress will now use this template instead of the original
January 13, 2023 at 6:24 pm #233826In reply to: Customizing the bbPress login page
pcwd
ParticipantTheme my login does not allow embedding.
As I wrote at the beginning of the post, I would like to customize the bbpress login page.
Can you help me run that PHP code with Code Snippets?
Thank you very much!January 13, 2023 at 3:03 pm #233823In reply to: Customizing the bbPress login page
pcwd
Participant<?php if ( ! is_user_logged_in() ) { // Display WordPress login form: $args = array( 'redirect' => admin_url(), 'form_id' => 'loginform-custom', 'label_username' => __( 'Username custom text' ), 'label_password' => __( 'Password custom text' ), 'label_remember' => __( 'Remember Me custom text' ), 'label_log_in' => __( 'Log In custom text' ), 'remember' => true ); wp_login_form( $args ); } else { // If logged in: wp_loginout( home_url() ); // Display "Log Out" link. echo " | "; wp_register('', ''); // Display "Site Admin" link. } ?>
I entered that code with the Code Snippets Plugin but it didnโt work ๐
January 13, 2023 at 2:55 pm #233821In reply to: Customizing the bbPress login page
Robin W
Moderatorthat is a page full of code – so what did you put in?
January 13, 2023 at 2:38 pm #233820In reply to: Customizing the bbPress login page
pcwd
ParticipantHi Robin,
thanks for your reply.I entered that code with the Code Snippets Plugin but it didn’t work. Why?
January 13, 2023 at 2:03 pm #233819In reply to: Customizing the bbPress login page
Robin W
ModeratorPut 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
January 13, 2023 at 4:53 am #233815In reply to: Function to return all replies to a topic
Robin W
Moderatordid you correct the error in this line
if (!empty ($topic) {
should be
if (!empty ($topic)) {
January 12, 2023 at 9:11 pm #233805In reply to: Function to return all replies to a topic
saciojote
ParticipantHi Robin, thank you for the example code! I have tried it and it seems to return the same value regardless of the title, so I am unsure…
Here is the sample code that I have used the function within:
function return_content_replies() { $title = $_POST['title']; $topic_id = rew_find_topic_id($title); if ( $topic_id == 'empty' ) { // create the topic here } else { $args = array( 'post_parent' => $topic_id, // ID of the topic 'order' => 'ASC', // Order of the replies (ASC or DESC) ); $replies_array = array(); if ( bbp_has_replies( $args ) ) { while ( bbp_replies() ) { bbp_the_reply(); $replies_array[] = array( 'id' => bbp_get_reply_id(), 'content' => bbp_get_reply_content(), 'date' => bbp_get_reply_post_date(), ); } } $response = array( 'status' => 'success', 'message' => $topic_id); } wp_send_json($response); }
-
AuthorSearch Results