# authorizer/2.8.7/js/authorizer-public.js

Authorizer, version 2.8.7. 25 lines.

- Page: https://pluginprobe.com/plugins/authorizer/2.8.7/code/js/authorizer-public.js
- Raw: https://pluginprobe.com/plugins/authorizer/2.8.7/raw/js/authorizer-public.js
- Modified: 2018-06-30T00:59:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/authorizer/2.8.7/code/js/authorizer-public.js#L10-L20`.

```javascript
/**
 * Displays an alert for anonymous users at the top of pages marked 'public'
 * instructing them to log in. Example alert: "Notice: You are browsing this
 * site anonymously, and only have access to a portion of its content."
 */

/* global document, auth */
( function( $ ) {

	$( document ).ready( function() {
		auth.wpLoginUrl = 'undefined' !== typeof auth.wpLoginUrl ? auth.wpLoginUrl : '/wp-login.php';
		auth.publicWarning = 'undefined' !== typeof auth.publicWarning ? auth.publicWarning : false;
		if ( auth.publicWarning ) {
			$( '#main' ).prepend(' \
				<div id="alert" class="alert alert-info auth-alert"> \
					<button type="button" class="close" data-dismiss="alert">&times;</button> \
					' + auth.anonymousNotice + ' \
					<a class="button" href="' + auth.wpLoginUrl + '">' + auth.logIn + '</a> \
				</div> \
			');
		}
	});

} )( jQuery );

```
