Skip to:
Content
Pages
Categories
Search
Top
Bottom

BBP_Forums_Widget bug


  • mtissington
    Participant

    @mtissington

    The html <a> link for the list of forums is wrong – it include white space in the front.
    If you don’t think it’s a bug, then where do I place a modified widgets.php in my theme to fix the issue?

    this is from BBP_Forums_Widget

    				<a class="bbp-forum-title" href="<?php bbp_forum_permalink( $widget_query->post->ID ); ?>">
    						<?php bbp_forum_title( $widget_query->post->ID ); ?>
    					</a>
    

    and this is from BBP_Topics_Widget which displays correctly with no leading white space.

    					<a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>
    
Viewing 3 replies - 1 through 3 (of 3 total)

  • mtissington
    Participant

    @mtissington

    I should add example which shows the issue for the forum list in the right side bar.


    Robin W
    Moderator

    @robin-w

    interesting..it looks ok on my test site, but I can see it doesn’t on yours.

    I should state that I am just a bbpress user who helps out here, not the plugin author.

    2 choices

    1. amend the actual widget file – yes that is said by many to be bad practice, but bbpress does not do frequent releases, and if it is your site and you know what you changed, is probably the quickest and easiest answer

    2. clone the widget to your theme’s child functions file. so take the whole function that starts

    class BBP_Forums_Widget extends WP_Widget {

    Now you’ll need to rename it, so change BBP_Forums_Widget wherever quoted to something unique, and change names/title in these lines

    
    public function __construct() {
    		$widget_ops = apply_filters( 'bbp_forums_widget_options', array(
    			'classname'                   => 'widget_display_forums',
    			'description'                 => esc_html__( 'A list of forums with an option to set the parent.', 'bbpress' ),
    			'customize_selective_refresh' => true
    		) );
    
    		parent::__construct( false, esc_html__( '(bbPress) Forums List', 'bbpress' ), $widget_ops );
    	}
    
    	/**
    	 * Register the widget
    	 *
    	 * @since 2.0.0 bbPress (r3389)
    	 */
    	public static function register_widget() {
    		register_widget( 'BBP_Forums_Widget' );
    	}

    you can then amend the offending line.


    mtissington
    Participant

    @mtissington

    Thanks – appreciate the help

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Skip to toolbar