Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Is it possible in Buddy Press to give only permission to delete private message

@anonymized-16484011

Inactive

Hi !

Prashant,

Thanks for this fast answer.

I wrap button code as per your instruction. But I think I am not a good developer so may be I am doing some mistake and output not came proper.

I explain you what I do.

First I open single.php file and went to the line no. 49 where “Delete” word. (Which line I was delete previous). I put your code and try to wrap but delete button goes from admin also and all other roles also. See my warping code below…

Before Wrap Code (Here Delete Button Shows To All)

			
			<div class="highlight-button">
			
			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>"><i class="fas fa-trash-alt"></i><?php _e( 'Delete', 'youzer' ); ?></a>
			
			</div>
			

After Wrap Code (Here Delete Button Goes from All User)


			<div class="highlight-button">
			<?php if(current_user_can(‘manage_options’)){?> 
			
			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>"><i class="fas fa-trash-alt"></i><?php _e( 'Delete', 'youzer' ); ?></a>
			
			<?php }?> 
			</div>
			

I also add warping before div class

Before Wrap Code (Here Delete Button Shows To All)

			
			<div class="highlight-button">
			
			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>"><i class="fas fa-trash-alt"></i><?php _e( 'Delete', 'youzer' ); ?></a>
			
			</div>
			

After Wrap Code (Here Delete Button Goes from All User)


			<?php if(current_user_can(‘manage_options’)){?> 
			<div class="highlight-button">
			
			
			<a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>"><i class="fas fa-trash-alt"></i><?php _e( 'Delete', 'youzer' ); ?></a>
			
			
			</div>
			<?php }?> 
			

So, Please tell me which silly mistake I am doing ?

Before wrapping the button shows to all and after wrapping it’s hide for (gone from) all.
Regards

Skip to toolbar