Skip to content

Commit

Permalink
add 'useronline_bots' filter
Browse files Browse the repository at this point in the history
  • Loading branch information
scribu committed Jul 27, 2011
1 parent eb5a81e commit 562e2a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core.php
Expand Up @@ -106,8 +106,10 @@ function record( $page_url = '', $page_title = '' ) {
'Amazon' => 'amazonaws.com'
);

$bots = apply_filters( 'useronline_bots', $bots );

$bot_found = false;
foreach ( $bots as $name => $lookfor )
foreach ( $bots as $name => $lookfor ) {
if ( stristr( $user_agent, $lookfor ) !== false ) {
$user_id = 0;
$user_name = $name;
Expand All @@ -117,6 +119,7 @@ function record( $page_url = '', $page_title = '' ) {

break;
}
}

// If No Bot Is Found, Then We Check Members And Guests
if ( !$bot_found ) {
Expand Down
5 changes: 3 additions & 2 deletions readme.txt
Expand Up @@ -3,7 +3,7 @@ Contributors: GamerZ, scribu
Donate link: http://lesterchan.net/site/donation/
Tags: useronline, usersonline, wp-useronline, online, users, user, ajax, widget
Requires at least: 3.0
Tested up to: 3.0
Tested up to: 3.2
Stable tag: 2.80

Enable you to display how many users are online on your Wordpress blog with detailed statistics.
Expand Down Expand Up @@ -97,8 +97,9 @@ Make sure your host is running PHP 5. The only foolproof way to do this is to ad
== Changelog ==

= 2.81 =
* fix "Return to default" buttons
* fixed "Return to default" buttons
* show user list in admin only to users with 'manage_options' capability
* added 'useronline_bots' filter

= 2.80 =
* don't show url and referral links for users in the admin area
Expand Down

0 comments on commit 562e2a3

Please sign in to comment.