WordPress.org

Ready to get started?Download WordPress

Forums

WP Dashboard Chat
Let Administrators Delete Messages (1 post)

  1. jameswoon
    Member
    Posted 1 year ago #

    So, here is a fix to let 'admins' (assuming only admins have the 'manage_options' capability) delete messages:
    Change the following

    wp-dashboard-chat.php:166-170

    if ($message->user_id == $this->current_user->ID ) {
    			echo '<a href="javascript:void(0)" class="del" data-mid="' . $message->id . '"></a>';
    		} else {
    			echo '<a href="javascript:void(0)" class="rep" data-mid="' . $message->id . '" username="' . $author->nickname . '"></a>';
    		}

    to

    if ($message->user_id == $this->current_user->ID ) {
    			echo '<a href="javascript:void(0)" class="del" data-mid="' . $message->id . '"></a>';
    		} else {
    			if (current_user_can('manage_options')) {
    				echo '<a href="javascript:void(0)" class="del" data-mid="' . $message->id . '"></a>';
    			}
    			echo '<a href="javascript:void(0)" class="rep" data-mid="' . $message->id . '" username="' . $author->nickname . '"></a>';
    		}

    http://wordpress.org/extend/plugins/wp-dashboard-chat/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.