WordPress.org

Support

Support » Plugins and Hacks » WP Dashboard Chat » Let Administrators Delete Messages

Let Administrators Delete Messages

  • 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/

  • The topic ‘Let Administrators Delete Messages’ is closed to new replies.
Skip to toolbar