Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1 through 25 (of 32,468 total)
  • Author
    Search Results
  • #246550
    Sirmadsen
    Participant

    I got the editor and this plugin to work by adding a code to my themes functions.php (child theme if you use that)

    function bbp_enable_visual_editor( $args = array() ) {
        $args['tinymce'] = true;
        $args['teeny'] = false;
        return $args;
    }
    add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );

    It activates the TinyMCE editor in BBPress.

    #246533
    a7xfanben
    Participant

    When a user quotes another post using the quote button, their post shows the bbcode as plain text. I tried to recreate the issue on my end with a test account (non-admin) in incognito mode, and was not able to recreate the issue. Any idea what could be causing it? (example linked below)

    Wordpress version: 6.8.2
    bbPress version: 2.6.14
    Link: example post with issue

    #246492

    In reply to: Bug https url

    Robin W
    Moderator

    since it is you asking 🙂

    add_filter( 'bbp_make_clickable', 'rewst', 10 , 2 ) ;
    function rewst ($ret, $text ){
    	$ret = str_replace ('http://' , 'https://' , $ret);
    	return $ret ;
    }

    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

    #246489

    In reply to: Bug https url

    Ricsca2
    Participant

    But seriously, are you telling me that it is normal that if a user writes www.google.com on bbpress it becomes http://www.google.com and not https:?

    #246485

    In reply to: Bug https url

    Ricsca2
    Participant

    I couldn’t explain…
    If I type www.google.com when I post the topic, it becomes http://www.google.com instead of https://www.google.com

    Try writing a URL with only www and submitting the topic.

    #246466
    Robin W
    Moderator

    This should do it

    .bbp-topics .sticky a.bbp-author-link span.bbp-author-avatar {
        display: none !important;
    }
    #246459
    Robin W
    Moderator

    I’m just a volunteer here – I don’t think this will get added to the core.

    so it will need code, and a plugin is just code with a wrapper.

    If you are concerned about performance, you should be using a caching plugin

    #246455
    andrew55
    Participant

    I have this css in my child theme css file:

    .bbp-topics ul.sticky .bbp-author-avatar {
        display: none !important;
    }

    But it doesn’t hide the avatar. Any suggestions on how to get this to work properly?

    #246443
    Amin
    Participant

    Sorry to bring this ancient topic up! But this issue is stil present after 11 years! It’s not a theme issue, I changed theme to the wordpress default.

    Topics are sorted by freshness in each individual forum, but not in the forum index page at example.com/forum

    I also added this in my custom plugin, bt no success:

    function freshness_topic_order( $args ) {
    		$args['meta_key']='_bbp_last_active_time';
                    $args['orderby']='meta_value';
                    $args['order']='DESC';  //change to ASC to put oldest at top
                    return $args;
    }
    add_filter('bbp_before_has_topics_parse_args','freshness_topic_order');
    Ricsca2
    Participant

    I get this warning in Search Console…

    More than 2,000 of your forum pages are missing structured data for discussion forums.
    Once implemented, Google can identify and display related online discussions on your site in relevant search results features.

    And it redirects me to this guide:

    https://developers.google.com/search/docs/appearance/structured-data/discussion-forum?hl=en&authuser=1

    Is there anything I can do?

    #246401
    thinlizzie
    Participant

    Hi Robin, yes that’s correct. The previous system worked fine but was not really encouraging forum participation so it will be replaced.

    The daily-limit is handled by a simple flag in the usermeta table, all good.

    I’m really just asking if there exists a combo version of bbp_new_topic and bbp_new_reply for me to hook onto, or if I should simply hook onto both of those, separately.

    eg.

    
    add_action( 'bbp_new_topic' , 'my_reward_function' );
    add_action( 'bbp_new_reply' , 'my_reward_function' );
    
    function my_reward_function() {
    
    	// check daily-limit flag, bail if set to today's date
    	// update the user's reward info
    	// set daily-limit flag to today's date
    }
    
    #246384
    Robin W
    Moderator
    .bbp-topics-front ul.super-sticky, .bbp-topics ul.super-sticky, .bbp-topics ul.sticky, .bbp-forum-content ul.sticky {
    	background-color: transparent !important;
    }

    and for closed and sticky

     .bbp-topics-front ul.super-sticky.status-closed, .bbp-topics ul.super-sticky.status-closed, .bbp-topics ul.sticky.status-closed, .bbp-forum-content ul.sticky.status-closed {
    	background-color: red !important;
    } 
    #246381
    kal123
    Participant

    I have disabled all plugins other than buddypress and bbpress.
    Issue requires both to enabled. buddypress by itself does not cause this.

    I am seeing this VERY HIGH log spam on every page load:

    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the bbpress domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in …/wp-includes/functions.php on line 6121

    yt
    Participant

    Hello
    My question is:
    In the address

    Layout and functionality – Examples you can use

    In the issue
    25.Restricting User Access to the WordPress backend

    Add this PHP code snippet so that only users who can only edit posts can access the WordPress admin section.
    Which was introduced to prevent the logged-in user from accessing the counter of the following code

    /**
    * Redirect back to homepage and not allow access to
    * WP backend for Subscribers.
    */
    function rkk_redirect_admin(){
    if ( ! current_user_can( ‘edit_posts’ ) ){
    wp_redirect( site_url() );
    exit;
    }
    }
    add_action( ‘admin_init’, ‘rkk_redirect_admin’ );

    The code works fine, but the bug is that:

    Although it appears to prevent a common user from accessing the WordPress dashboard, the same user can easily bypass the code ban and log in to the dashboard by opening a new tab in the browser and entering the address

    https://wordpress.org/wp-admin/

    in that tab and pressing Enter. This is the bug in the above code.

    The question is:
    How can I change the above code to prevent the trick of logging into the dashboard as described above?

    Thank you in advance for your advice.

    #246343
    andrew55
    Participant

    I have errors appearing on forum, above all the content: Warning:

    Undefined array key "capabilities" in /home/lifeleap/public_html/community/wp-includes/class-wp-roles.php on line 292

    Any ideas on what this error might be related or what I can do to troubleshoot/fix this issue?

    Thank you for any help.

    #246052

    In reply to: Topic to be approved

    Ricsca2
    Participant

    Is it because of this option I set by chance?

    Before a comment appears: Comment authors must have a previously approved comment.

    I also set “Keep a comment in queue if it contains 2 or more links (a common characteristic of comment spam is a large number of links).”

    and the post had 4 images loaded via code and HTML links.

    Are forum topics and comments treated as if they were WP comments?

    Thanks

    #246024
    agencenobilito44
    Participant

    Bonjour,

    J’appelle sur mon site :
    echo do_shortcode(‘[bbp-topic-index show="5" show_search="false"]‘);
    Seulement le moteur de recherche s’affiche quand mĂŞme, avez-vous une idĂ©e ou une solution svp ?
    Merci

    I’m calling on my website:
    echo do_shortcode(‘[bbp-topic-index show="5" show_search="false"]‘);
    Only the search engine is still displayed. Do you have any ideas or solutions, please?
    Thanks

    Robin W
    Moderator

    For those who are less keen on code, or who install or already have

    bbp style pack

    then just go to

    dashboard>settings>bbp style pack>Topic/Reply Form

    and use option 6

    Ricsca2
    Participant

    Hi everyone,

    I’d like to share a very useful snippet for bbPress that I had a hard time finding on Google, but which can save a lot of time.

    For many communities it’s extremely helpful to have the “Notify me of follow-up replies via email” box checked by default. This way, users are automatically notified of new replies and are more likely to come back to the forum and engage in the discussion.

    Here is a simple solution that works on the latest WordPress + bbPress. Just add it to your theme’s functions.php or into a small custom plugin:

    
    // Auto-check the "Notify me of follow-up replies via email" box (topic + reply forms)
    add_action('wp_footer', function () {
        if (is_admin() || !function_exists('bbp_is_subscriptions_active') || !bbp_is_subscriptions_active() || !is_user_logged_in()) {
            return;
        }
        ?>
        <script>
        document.addEventListener('DOMContentLoaded', function () {
            var t = document.getElementById('bbp_topic_subscription');
            if (t && !t.checked) t.checked = true;
    
            var r = document.getElementById('bbp_reply_subscription');
            if (r && !r.checked) r.checked = true;
        });
        </script>
        <?php
    }, 99);
    

    With this snippet, whenever a logged-in user creates a new topic or reply, the subscription checkbox will already be checked by default.
    Of course, the user can still uncheck it if they don’t want notifications.

    This small trick makes it much easier to keep members engaged and ensures they don’t miss important replies.

    Hope it helps others too, since I believe this should be more widely documented!

    #245921
    Robin W
    Moderator

    but yes it’s fixed in 2.6.14

    // BuddyPress < 12.0 (deprecated code is intentionally included)
    		if ( function_exists( 'bp_core_get_user_domain' ) ) {
    			$url = array( bp_core_get_user_domain( $user_id ) );
    
    		// BuddyPress > 12.0 (rewrite rules)
    		} elseif ( function_exists( 'bp_members_get_user_url' ) ) {
    			$url = array( bp_members_get_user_url( $user_id ) );
    		}
    #245916
    Robin W
    Moderator

    Very briefly tested as I am on holiday tomorrow, but try this

    $r = array(
    		'post_type'              =>bbp_get_reply_post_type(),   
    		'post_parent'            => $topic_id,  
    		'author__not_in' => array( $author_id)
    		);
    	$reply_posts = new WP_Query($r); 
    	$count = $reply_posts->post_count;
    thinlizzie
    Participant

    Hi Robin,

    I’m writing some code to pay a little “reward points” bonus to the author of a forum topic, when that topic receives X number of replies.
    All works fine, hooking to bbp_new_reply.
    But I would like to exclude any replies by the author themself from the total replies count.
    Total replies count is currently bbp_get_topic_reply_count( $topic_id )
    So I need to subtract author_own_replies from that total.

    I have $topic_id, $author_id, $reply_id, $forum_id

    Any easy way to achieve this?

    I’m trying to avoid SQL queries.

    #245910
    internationaljack
    Participant

    Sure!

    	/**
    	 * Reads entire file into a string.
    	 *
    	 * @since 2.5.0
    	 *
    	 * @param string $file Name of the file to read.
    	 * @return string|false Read data on success, false if no temporary file could be opened,
    	 *                      or if the file couldn't be retrieved.
    	 */
    	public function get_contents( $file ) {
    		$tempfile   = wp_tempnam( $file );
    		$temphandle = fopen( $tempfile, 'w+' );
    
    		if ( ! $temphandle ) {
    			unlink( $tempfile );
    			return false;
    		}
    
    		if ( ! ftp_fget( $this->link, $temphandle, $file, FTP_BINARY ) ) {
    			fclose( $temphandle );
    			unlink( $tempfile );
    			return false;
    		}
    
    		fseek( $temphandle, 0 ); // Skip back to the start of the file being written to.
    		$contents = '';
    
    		while ( ! feof( $temphandle ) ) {
    			$contents .= fread( $temphandle, 8 * KB_IN_BYTES );
    		}
    
    		fclose( $temphandle );
    		unlink( $tempfile );
    
    		return $contents;
    	}

    Line 146 is if ( ! ftp_fget( $this->link, $temphandle, $file, FTP_BINARY ) ) {

    #245907
    internationaljack
    Participant

    Thank you for helping me interpret that!

    This is what was on that line:
    <p class="logo_tagline"><?php bloginfo(description); ?></p>

    I added single quotes to 'description' and now the forums fully load (when FS_METHOD is set to direct). That line was basically the only difference between the original bbpress.php and the child theme’s copy of bbpress.php.

    Unfortunately, that fix only works with FS_METHOD set to direct. I need it set to ftpext so WordPress requests FTP credentials (for things like plugin updates), because otherwise WP doesn’t have write permission.

    When I change FS_METHOD to ftpext, the forum pages start giving me the ol’ “There has been a critical error on this website” message.
    The log gives me this:
    [08-Aug-2025 17:23:55 UTC] PHP Fatal error: Uncaught TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, null given in /var/www/vhosts/[SITEURL]/httpdocs/wp-admin/includes/class-wp-filesystem-ftpext.php:146

    That’s not a bbPress file, so I think I’ll have to talk with our webhost about this.

    Thanks for your help!

    Robin W
    Moderator

    This has been removed probably because it no longer worked.

    Since bbpress just uses WordPress login, If you google ‘modal popup login wordpress’ you’ll find both code and plugins that do this

Viewing 25 results - 1 through 25 (of 32,468 total)
Skip to toolbar