PluginProbe
Authorizer / 2.6.11
Authorizer v2.6.11
3.16.0 3.15.3 3.15.2 3.15.1 3.15.0 3.14.3 3.14.4 3.14.2 3.14.1 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.10 2.9.11 2.9.12 2.9.13 2.9.2 2.9.3 All 127 releases
← All changes | js/authorizer-public.js +13 -20 3.15.2 → 2.6.11 View file →
@@ -1,20 +1,13 @@
1 -/**
2 - * Displays an alert for anonymous users at the top of pages marked 'public'
3 - * instructing them to log in. Example alert: "Notice: You are browsing this
4 - * site anonymously, and only have access to a portion of its content."
5 - */
6 -
7 -/* global document, auth */
8 -( function( $ ) {
9 -
10 - $( document ).ready( function() {
11 - $( '#main' ).prepend(
12 - '<div id="alert" class="alert alert-info auth-alert" style="margin: 0 0 20px;">' +
13 - '<button type="button" class="close" data-dismiss="alert">&times;</button>' +
14 - auth.anonymousNotice +
15 - '<a class="button" href="' + auth.wpLoginUrl + '">' + auth.logIn + '</a>' +
16 - '</div>'
17 - );
18 - } );
19 -
20 -} )( jQuery );
1 +jQuery( document ).ready( function( $ ) {
2 + auth.wp_login_url = typeof auth.wp_login_url !== 'undefined' ? auth.wp_login_url : '/wp-login.php';
3 + auth.public_warning = typeof auth.public_warning !== 'undefined' ? auth.public_warning : false;
4 + if ( auth.public_warning ) {
5 + $( '#main' ).prepend(' \
6 + <div id="alert" class="alert alert-info auth-alert"> \
7 + <button type="button" class="close" data-dismiss="alert">&times;</button> \
8 + ' + auth.anonymous_notice + ' \
9 + <a class="button" href="' + auth.wp_login_url + '">' + auth.log_in + '</a> \
10 + </div> \
11 + ');
12 + }
13 +});