New
PeoplePress is here. Community building for WordPress, reimagined. Fast, modern, and built for the communities you've always wanted to run.
See it live

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Thank you.

    We have two approaches.

    1. We can use a translation tool to replace ‘report’ with   or space and it will work.
    2. Or we can filter the button markup and update it

    
    
    /**
     * Filter Moderation button for activity/comment.
     *
     * @param string $button button markup.
     * @param array  $args args.
     *
     * @return string
     */
    function bpmts_custom_button_filter( $button, $args ) {
    
    	if ( ! isset( $args['item_type'] ) || ! in_array( $args['item_type'], array( 'bp_activity', 'bp_acomment' ) ) ) {
    		return $button;
    	}
    	$label = '<span>' . __( 'Report', 'buddypress-moderation-tools' ) . '</span>';
    
    	$use_bp_button_markup = $args['use_wrapper'];
    	$wrapper_tag          = $args['wrapper_tag'];
    	ob_start();
    
    	?>
    	<a href="#" data-item-id="<?php echo esc_attr( $args['item_id'] ); ?>"
    	   data-item-type="<?php echo esc_attr( $args['item_type'] ); ?>"
    	   data-context="<?php echo esc_attr( $args['context'] ); ?>"
    	   data-context-id="<?php echo esc_attr( $args['context_id'] ); ?>"
    	   class="bpmts-report-button <?php echo $args['link_class']; ?>"><?php echo $label; ?></a>
    
    	<?php
    	$button = ob_get_clean();
    	if ( $use_bp_button_markup ) {
    		$button = "<{$wrapper_tag} class='bpmts-moderation-button-wrap bpmts-type-{$args['item_type']}-button generic-button {$args['wrapper_class']}'>{$button}</{$wrapper_tag}>";
    	}
    
    	return $button;
    }
    
    add_filter( 'bpmts_report_button', 'bpmts_custom_button_filter', 10, 2 );
    
    

    You may put it in your child theme or bp-custom.php and then use css to hide the span wrapping the text.

    That should do it. Please give it a try and let me know.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Mic,
    Thank you.

    1. Can you please disable the Share plugin temporarily. It has incorrect markup and is leading the report button to the next line(we are putting lower priority to show the report button as last. That makes the button affected by other plugin’s issues).

    Please do and I will share some css. It is simple.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Carsten,
    Thank you.

    I will share an example with css for the same. Will link here after the post.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Yes. That will be the case. The only thing missing will be that you can not set time limit.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Mic,
    Thank you for the topic.

    Since the icons are supplied by the theme, you are not seeing it for 3rd party plugins. It can be easily addded for the buttons from 3rd party plugins too.

    Please link me to the site and provide a guest account(subscriber) and I can help you with the css(Is the details same as shared in another thread?).

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi Carsten,
    Thank you.
    Part 2 will be available in next 1-2 week.

    About 2 forms, did you mean the left/right 2 column layout? It is not two form, It is only one form.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Also, we can put some code for this(comment based on user role for each post) but we can not make it honour the time limit as that will need a lot more time.
    Simple role based limit per post will take less time and I can gladly assist you with it.

    Please let me know.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25513

    Hi,
    Since we modified the code for time limit, we can not use the modified code for your new scenario. Will that be fine?

    Regards
    Brajesh