Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | User Menus – Nav Menu Visibility |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.1
- assets/images/icon-128x128.png +0 -0
- assets/scripts/admin.js +37 -11
- assets/scripts/admin.min.js +1 -1
- assets/styles/admin.css +51 -15
- assets/styles/admin.css.map +1 -1
- assets/styles/admin.min.css +1 -1
- assets/styles/sass/admin.scss +50 -16
- includes/classes/admin/menu-editor.php +9 -3
- includes/classes/admin/menu-settings.php +26 -6
- includes/classes/admin/reviews.php +479 -0
- includes/classes/menu/item.php +1 -0
- includes/classes/menu/items.php +9 -1
- includes/classes/user/codes.php +7 -6
- languages/user-menus.pot +71 -15
- readme.txt +14 -19
- user-menus.php +18 -17
assets/images/icon-128x128.png
ADDED
Binary file
|
assets/scripts/admin.js
CHANGED
@@ -6,23 +6,38 @@
|
|
6 |
$url = $this.parents('.menu-item').find('.nav_item_options-redirect_url');
|
7 |
|
8 |
if ($this.val() == 'custom') {
|
9 |
-
$url.
|
10 |
} else {
|
11 |
-
$url.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
}
|
13 |
}
|
14 |
|
15 |
function which_users() {
|
16 |
var $this = $(this),
|
17 |
$item = $this.parents('.menu-item'),
|
18 |
-
$roles = $item.find('.nav_item_options-roles')
|
|
|
19 |
|
20 |
-
if ($this.val()
|
21 |
-
$roles.
|
22 |
$item.addClass('show-insert-button');
|
|
|
23 |
} else {
|
24 |
-
$roles.
|
25 |
-
$
|
|
|
|
|
26 |
}
|
27 |
}
|
28 |
|
@@ -40,13 +55,21 @@
|
|
40 |
$('.jpum-user-codes').removeClass('open');
|
41 |
}
|
42 |
|
43 |
-
function insert_user_code() {
|
44 |
var $this = $(this),
|
45 |
$input = $this.parents('p').find('input'),
|
46 |
val = $input.val();
|
47 |
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
reset_user_codes();
|
|
|
|
|
50 |
}
|
51 |
|
52 |
function append_user_codes() {
|
@@ -64,13 +87,16 @@
|
|
64 |
append_user_codes();
|
65 |
$(".nav_item_options-redirect_type select").each(redirect_type);
|
66 |
$('.nav_item_options-which_users select').each(which_users);
|
|
|
|
|
67 |
}
|
68 |
|
69 |
$document
|
70 |
.on('change', '.nav_item_options-redirect_type select', redirect_type)
|
71 |
.on('change', '.nav_item_options-which_users select', which_users)
|
72 |
-
.on('
|
73 |
-
.on('click', '.jpum-user-codes
|
|
|
74 |
.on('click', reset_user_codes)
|
75 |
.ready(refresh_all_items);
|
76 |
|
6 |
$url = $this.parents('.menu-item').find('.nav_item_options-redirect_url');
|
7 |
|
8 |
if ($this.val() == 'custom') {
|
9 |
+
$url.slideDown();
|
10 |
} else {
|
11 |
+
$url.slideUp();
|
12 |
+
}
|
13 |
+
}
|
14 |
+
|
15 |
+
function avatar_check() {
|
16 |
+
var $label = $(this),
|
17 |
+
$size = $label.parents('.menu-item').find('.nav_item_options-avatar_size');
|
18 |
+
|
19 |
+
if ($label.val().indexOf('{avatar}') >= 0) {
|
20 |
+
$size.slideDown();
|
21 |
+
} else {
|
22 |
+
$size.slideUp();
|
23 |
}
|
24 |
}
|
25 |
|
26 |
function which_users() {
|
27 |
var $this = $(this),
|
28 |
$item = $this.parents('.menu-item'),
|
29 |
+
$roles = $item.find('.nav_item_options-roles'),
|
30 |
+
$insert_button = $item.find('.jpum-user-codes');
|
31 |
|
32 |
+
if ($this.val() === 'logged_in') {
|
33 |
+
$roles.slideDown();
|
34 |
$item.addClass('show-insert-button');
|
35 |
+
$insert_button.fadeOut(0).fadeIn();
|
36 |
} else {
|
37 |
+
$roles.slideUp();
|
38 |
+
$insert_button.fadeOut(function () {
|
39 |
+
$item.removeClass('show-insert-button');
|
40 |
+
});
|
41 |
}
|
42 |
}
|
43 |
|
55 |
$('.jpum-user-codes').removeClass('open');
|
56 |
}
|
57 |
|
58 |
+
function insert_user_code(event) {
|
59 |
var $this = $(this),
|
60 |
$input = $this.parents('p').find('input'),
|
61 |
val = $input.val();
|
62 |
|
63 |
+
event.which = event.which || event.keyCode;
|
64 |
+
|
65 |
+
if (event.type === 'keypress' && event.keyCode !== 13 && event.keyCode !== 32 ) {
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
$input.val(val + "{" + $this.data('code') + "}").trigger('change');
|
70 |
reset_user_codes();
|
71 |
+
|
72 |
+
event.preventDefault();
|
73 |
}
|
74 |
|
75 |
function append_user_codes() {
|
87 |
append_user_codes();
|
88 |
$(".nav_item_options-redirect_type select").each(redirect_type);
|
89 |
$('.nav_item_options-which_users select').each(which_users);
|
90 |
+
$('.nav_item_options-which_users select').each(which_users);
|
91 |
+
$('input.edit-menu-item-title').each(avatar_check);
|
92 |
}
|
93 |
|
94 |
$document
|
95 |
.on('change', '.nav_item_options-redirect_type select', redirect_type)
|
96 |
.on('change', '.nav_item_options-which_users select', which_users)
|
97 |
+
.on('change keyup focusout', 'input.edit-menu-item-title', avatar_check)
|
98 |
+
.on('click', '.jpum-user-codes > button', toggle_user_codes)
|
99 |
+
.on('click keypress', '.jpum-user-codes li > a', insert_user_code)
|
100 |
.on('click', reset_user_codes)
|
101 |
.ready(refresh_all_items);
|
102 |
|
assets/scripts/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"use strict";function n(){var t=e(this),n=t.parents(".menu-item").find(".nav_item_options-redirect_url");"custom"==t.val()?n.
|
1 |
+
!function(e,t){"use strict";function n(){var t=e(this),n=t.parents(".menu-item").find(".nav_item_options-redirect_url");"custom"==t.val()?n.slideDown():n.slideUp()}function i(){var t=e(this),n=t.parents(".menu-item").find(".nav_item_options-avatar_size");t.val().indexOf("{avatar}")>=0?n.slideDown():n.slideUp()}function s(){var t=e(this),n=t.parents(".menu-item"),i=n.find(".nav_item_options-roles"),s=n.find(".jpum-user-codes");"logged_in"===t.val()?(i.slideDown(),n.addClass("show-insert-button"),s.fadeOut(0).fadeIn()):(i.slideUp(),s.fadeOut(function(){n.removeClass("show-insert-button")}))}function o(){e(this).parent().toggleClass("open")}function a(t){void 0!==t&&e(t.target).parents(".jpum-user-codes").length||e(".jpum-user-codes").removeClass("open")}function u(t){var n=e(this),i=n.parents("p").find("input"),s=i.val();t.which=t.which||t.keyCode,"keypress"===t.type&&13!==t.keyCode&&32!==t.keyCode||(i.val(s+"{"+n.data("code")+"}").trigger("change"),a(),t.preventDefault())}function c(){return e("input.edit-menu-item-title").each(function(){var t=e(this).parents("label"),n=_.template(e("#tmpl-jpum-user-codes").html());t.parents("p").find(".jpum-user-codes").length||t.after(n())})}function r(){c(),e(".nav_item_options-redirect_type select").each(n),e(".nav_item_options-which_users select").each(s),e(".nav_item_options-which_users select").each(s),e("input.edit-menu-item-title").each(i)}t.on("change",".nav_item_options-redirect_type select",n).on("change",".nav_item_options-which_users select",s).on("change keyup focusout","input.edit-menu-item-title",i).on("click",".jpum-user-codes > button",o).on("click keypress",".jpum-user-codes li > a",u).on("click",a).ready(r),e(".submit-add-to-menu").click(function(){setTimeout(r,1e3)})}(jQuery,jQuery(document));
|
assets/styles/admin.css
CHANGED
@@ -1,50 +1,86 @@
|
|
1 |
.jpum-user-codes {
|
2 |
display: none;
|
3 |
position: absolute;
|
4 |
-
right:
|
5 |
-
bottom:
|
6 |
}
|
7 |
|
8 |
-
.jpum-user-codes >
|
9 |
border: 1px solid;
|
10 |
border-radius: 2px;
|
11 |
-
background-color:
|
12 |
-
color: #
|
13 |
text-align: center;
|
14 |
cursor: pointer;
|
15 |
-
font-size:
|
16 |
-
height:
|
17 |
-
width:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
|
20 |
.jpum-user-codes ul {
|
21 |
display: none;
|
22 |
position: absolute;
|
23 |
top: 1px;
|
24 |
-
left:
|
25 |
background-color: #fff;
|
26 |
width: auto;
|
27 |
z-index: 999;
|
28 |
-
box-shadow: 1px 1px 5px -1px;
|
29 |
-
border: 1px solid rgba(0, 0, 0, 0.25);
|
30 |
}
|
31 |
|
32 |
.jpum-user-codes ul li {
|
33 |
display: block;
|
34 |
-
padding: .5em;
|
35 |
border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
|
|
|
36 |
}
|
37 |
|
38 |
-
.jpum-user-codes ul li
|
|
|
39 |
cursor: pointer;
|
40 |
-
display: block;
|
41 |
line-height: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
.jpum-user-codes ul li:last-child {
|
45 |
border-bottom: 0;
|
46 |
}
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
.jpum-user-codes.open ul {
|
49 |
display: block;
|
50 |
}
|
@@ -64,6 +100,6 @@
|
|
64 |
display: block;
|
65 |
}
|
66 |
|
67 |
-
/*# sourceMappingURL=data:application/json;base64,
|
68 |
|
69 |
/*# sourceMappingURL=admin.css.map */
|
1 |
.jpum-user-codes {
|
2 |
display: none;
|
3 |
position: absolute;
|
4 |
+
right: 1px;
|
5 |
+
bottom: 1px;
|
6 |
}
|
7 |
|
8 |
+
.jpum-user-codes > button {
|
9 |
border: 1px solid;
|
10 |
border-radius: 2px;
|
11 |
+
background-color: #23282d;
|
12 |
+
color: #eee;
|
13 |
text-align: center;
|
14 |
cursor: pointer;
|
15 |
+
font-size: 22px;
|
16 |
+
height: 22px;
|
17 |
+
width: 22px;
|
18 |
+
padding: 0;
|
19 |
+
outline: 0;
|
20 |
+
display: block;
|
21 |
+
}
|
22 |
+
|
23 |
+
.jpum-user-codes > button:focus {
|
24 |
+
border-color: #5b9dd9;
|
25 |
+
box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
|
26 |
+
}
|
27 |
+
|
28 |
+
.jpum-user-codes > button .dashicons {
|
29 |
+
width: 20px;
|
30 |
+
height: 20px;
|
31 |
+
font-size: 20px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.jpum-user-codes:hover > button {
|
35 |
+
background-color: #0073aa;
|
36 |
+
color: #fff;
|
37 |
}
|
38 |
|
39 |
.jpum-user-codes ul {
|
40 |
display: none;
|
41 |
position: absolute;
|
42 |
top: 1px;
|
43 |
+
left: 20px;
|
44 |
background-color: #fff;
|
45 |
width: auto;
|
46 |
z-index: 999;
|
47 |
+
/*box-shadow: 1px 1px 5px -1px; */
|
|
|
48 |
}
|
49 |
|
50 |
.jpum-user-codes ul li {
|
51 |
display: block;
|
|
|
52 |
border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
|
53 |
+
background-color: #23282d;
|
54 |
}
|
55 |
|
56 |
+
.jpum-user-codes ul li > a {
|
57 |
+
color: #eee;
|
58 |
cursor: pointer;
|
|
|
59 |
line-height: 1;
|
60 |
+
white-space: nowrap;
|
61 |
+
text-decoration: none;
|
62 |
+
display: block;
|
63 |
+
padding: .5em;
|
64 |
+
}
|
65 |
+
|
66 |
+
.jpum-user-codes ul li > a:focus {
|
67 |
+
color: #0073aa;
|
68 |
+
border: 0;
|
69 |
+
box-shadow: none;
|
70 |
}
|
71 |
|
72 |
.jpum-user-codes ul li:last-child {
|
73 |
border-bottom: 0;
|
74 |
}
|
75 |
|
76 |
+
.jpum-user-codes ul li:hover {
|
77 |
+
background-color: #0073aa;
|
78 |
+
}
|
79 |
+
|
80 |
+
.jpum-user-codes ul li:hover > a {
|
81 |
+
color: #fff;
|
82 |
+
}
|
83 |
+
|
84 |
.jpum-user-codes.open ul {
|
85 |
display: block;
|
86 |
}
|
100 |
display: block;
|
101 |
}
|
102 |
|
103 |
+
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRtaW4uY3NzIiwic291cmNlcyI6WyJhZG1pbi5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIi5qcHVtLXVzZXItY29kZXMge1xuXG4gIGRpc3BsYXk6IG5vbmU7XG5cbiAgcG9zaXRpb246IGFic29sdXRlO1xuICByaWdodDogMXB4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HJnYmEoMCwgMCwgMCwgLjI1KTtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6ICMyMzI4MmQ7XG5cbiAgICAgID4gYSB7XG4gICAgICAgIGNvbG9yOiAjZWVlO1xuICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgIGxpbmUtaGVpZ2h0OiAxO1xuICAgICAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgICAgICB0ZXh0LWRlY29yYXRpb246IG5vbmU7XG4gICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICBwYWRkaW5nOiAuNWVtO1xuXG4gICAgICAgICY6Zm9jdXMge1xuICAgICAgICAgIGNvbG9yOiAjMDA3M2FhO1xuICAgICAgICAgIGJvcmRlcjogMDtcbiAgICAgICAgICBib3gtc2hhZG93OiBub25lO1xuXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgJjpsYXN0LWNoaWxkIHtcbiAgICAgICAgYm9yZGVyLWJvdHRvbTogMDtcbiAgICAgIH1cblxuICAgICAgJjpob3ZlciB7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6ICMwMDczYWE7XG5cbiAgICAgICAgPiBhIHtcbiAgICAgICAgICBjb2xvcjogI2ZmZjtcblxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICB9XG5cbiAgfVxuXG4gICYub3BlbiB1bCB7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gIH1cblxufVxuXG4jbWVudS10by1lZGl0IHtcblxuICAubWVudS1pdGVtIHtcblxuICAgIHAuZGVzY3JpcHRpb24td2lkZSB7XG5cbiAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcblxuICAgIH1cblxuICAgIC5uYXZfaXRlbV9vcHRpb25zLXJvbGVzIHtcbiAgICAgIGxhYmVsIHtcbiAgICAgICAgd2lkdGg6IDMzJTtcbiAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgICAgICBmbG9hdDogbGVmdDtcbiAgICAgICAgb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AqDb;;AA3DD;EAUI,kBAAkB;EAClB,mBAAmB;EACnB,qCAAsB;EACtB,YAAY;EACZ,mBAAmB;EACnB,gBAAgB;EAEhB,gBAAgB;EAChB,YAAY;EACZ,WAAW;CAEZ;;AArBH;EAwBI,cAAc;EAEd,mBAAmB;EACnB,SAAS;EACT,WAAW;EACX,uBAAuB;EACvB,YAAY;EACZ,aAAa;EACb,6BAA6B;EAC7B,sCAAsB;CAoBvB;;AArDH;EAqCM,eAAe;EACf,cAAc;EACd,8CAA8B;CAY/B;;AAnDL;EA0CQ,gBAAgB;EAChB,eAAe;EACf,eAAe;CAChB;;AA7CP;EAgDQ,iBAAiB;CAClB;;AAjDP;EAwDI,eAAe;CAChB;;AAIH;EAMM,mBAAmB;CAEpB;;AARL;EAYQ,WAAW;EACX,sBAAsB;EACtB,YAAY;EACZ,gBAAgB;CACjB;;AAhBP;EAsBQ,eAAe;CAChB;;AClBP,6lHAA6lH","file":"admin.css","sourcesContent":[".jpum-user-codes {\n\n display: none;\n\n position: absolute;\n right: 2px;\n bottom: 2px;\n\n > span {\n\n border: 1px solid;\n border-radius: 2px;\n background-color: rgba(0, 0, 0, .5);\n color: #fff;\n text-align: center;\n cursor: pointer;\n\n font-size: 21px;\n height: 1em;\n width: 1em;\n\n }\n\n ul {\n display: none;\n\n position: absolute;\n top: 1px;\n left: 22px;\n background-color: #fff;\n width: auto;\n z-index: 999;\n box-shadow: 1px 1px 5px -1px;\n border: 1px solid rgba(0, 0, 0, .25);\n\n li {\n\n display: block;\n padding: .5em;\n border-bottom: 1px dashed rgba(0, 0, 0, .25);\n\n span {\n cursor: pointer;\n display: block;\n line-height: 1;\n }\n\n &:last-child {\n border-bottom: 0;\n }\n\n }\n\n }\n\n &.open ul {\n display: block;\n }\n\n}\n\n#menu-to-edit {\n\n .menu-item {\n\n p.description-wide {\n\n position: relative;\n\n }\n\n .nav_item_options-roles {\n label {\n width: 33%;\n display: inline-block;\n float: left;\n margin-top: 5px;\n }\n }\n\n &.show-insert-button {\n\n .jpum-user-codes {\n display: block;\n }\n\n }\n\n }\n\n}\n",".jpum-user-codes {\n display: none;\n position: absolute;\n right: 2px;\n bottom: 2px;\n}\n\n.jpum-user-codes > span {\n border: 1px solid;\n border-radius: 2px;\n background-color: rgba(0, 0, 0, 0.5);\n color: #fff;\n text-align: center;\n cursor: pointer;\n font-size: 21px;\n height: 1em;\n width: 1em;\n}\n\n.jpum-user-codes ul {\n display: none;\n position: absolute;\n top: 1px;\n left: 22px;\n background-color: #fff;\n width: auto;\n z-index: 999;\n box-shadow: 1px 1px 5px -1px;\n border: 1px solid rgba(0, 0, 0, 0.25);\n}\n\n.jpum-user-codes ul li {\n display: block;\n padding: .5em;\n border-bottom: 1px dashed rgba(0, 0, 0, 0.25);\n}\n\n.jpum-user-codes ul li span {\n cursor: pointer;\n display: block;\n line-height: 1;\n}\n\n.jpum-user-codes ul li:last-child {\n border-bottom: 0;\n}\n\n.jpum-user-codes.open ul {\n display: block;\n}\n\n#menu-to-edit .menu-item p.description-wide {\n position: relative;\n}\n\n#menu-to-edit .menu-item .nav_item_options-roles label {\n width: 33%;\n display: inline-block;\n float: left;\n margin-top: 5px;\n}\n\n#menu-to-edit .menu-item.show-insert-button .jpum-user-codes {\n display: block;\n}\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRtaW4uY3NzIiwic291cmNlcyI6WyJhZG1pbi5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIi5qcHVtLXVzZXItY29kZXMge1xuXG4gIGRpc3BsYXk6IG5vbmU7XG5cbiAgcG9zaXRpb246IGFic29sdXRlO1xuICByaWdodDogMnB4O1xuICBib3R0b206IDJweDtcblxuICA+IHNwYW4ge1xuXG4gICAgYm9yZGVyOiAxcHggc29saWQ7XG4gICAgYm9yZGVyLXJhZGl1czogMnB4O1xuICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMCwgMCwgMCwgLjUpO1xuICAgIGNvbG9yOi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2VSb290IjoiL3NvdXJjZS8ifQ== */\n"],"sourceRoot":"/source/"}
|
1 |
+
{"version":3,"sources":["/source/admin.scss","admin.css"],"names":[],"mappings":"AAAA;EAEE,cAAc;EAEd,mBAAmB;EACnB,WAAW;EACX,YAAY;CAuFb;;AA7FD;EASI,kBAAkB;EAClB,mBAAmB;EACnB,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,aAAa;EACb,YAAY;EACZ,WAAW;EACX,WAAW;EACX,eAAe;CAYhB;;AAhCH;EAuBM,sBAAsB;EACtB,4CAAwB;CACzB;;AAzBL;EA4BM,YAAY;EACZ,aAAa;EACb,gBAAgB;CACjB;;AA/BL;EAmCI,0BAA0B;EAC1B,YAAY;CACb;;AArCH;EAwCI,cAAc;EAEd,mBAAmB;EACnB,SAAS;EACT,WAAW;EACX,uBAAuB;EACvB,YAAY;EACZ,aAAa;EACb,kCAAkC;CAuCnC;;AAvFH;EAmDM,eAAe;EACf,8CAA8B;EAC9B,0BAA0B;CAgC3B;;AArFL;EAwDQ,YAAY;EACZ,gBAAgB;EAChB,eAAe;EACf,oBAAoB;EACpB,sBAAsB;EACtB,eAAe;EACf,cAAc;CAQf;;AAtEP;EAiEU,eAAe;EACf,UAAU;EACV,iBAAiB;CAElB;;AArET;EAyEQ,iBAAiB;CAClB;;AA1EP;EA6EQ,0BAA0B;CAM3B;;AAnFP;EAgFU,YAAY;CAEb;;AAlFT;EA0FI,eAAe;CAChB;;AAIH;EAMM,mBAAmB;CAEpB;;AARL;EAYQ,WAAW;EACX,sBAAsB;EACtB,YAAY;EACZ,gBAAgB;CACjB;;AAhBP;EAsBQ,eAAe;CAChB;;AChBP,i3KAAi3K","file":"admin.css","sourcesContent":[".jpum-user-codes {\n\n display: none;\n\n position: absolute;\n right: 1px;\n bottom: 1px;\n\n > button {\n border: 1px solid;\n border-radius: 2px;\n background-color: #23282d;\n color: #eee;\n text-align: center;\n cursor: pointer;\n font-size: 22px;\n height: 22px;\n width: 22px;\n padding: 0;\n outline: 0;\n display: block;\n\n &:focus {\n border-color: #5b9dd9;\n box-shadow: 0 0 2px rgba( 30, 140, 190, 0.8 );\n }\n\n .dashicons {\n width: 20px;\n height: 20px;\n font-size: 20px;\n }\n }\n\n &:hover > button {\n background-color: #0073aa;\n color: #fff;\n }\n\n ul {\n display: none;\n\n position: absolute;\n top: 1px;\n left: 20px;\n background-color: #fff;\n width: auto;\n z-index: 999;\n /*box-shadow: 1px 1px 5px -1px; */\n\n li {\n display: block;\n border-bottom: 1px dashed rgba(0, 0, 0, .25);\n background-color: #23282d;\n\n > a {\n color: #eee;\n cursor: pointer;\n line-height: 1;\n white-space: nowrap;\n text-decoration: none;\n display: block;\n padding: .5em;\n\n &:focus {\n color: #0073aa;\n border: 0;\n box-shadow: none;\n\n }\n }\n\n &:last-child {\n border-bottom: 0;\n }\n\n &:hover {\n background-color: #0073aa;\n\n > a {\n color: #fff;\n\n }\n }\n\n }\n\n }\n\n &.open ul {\n display: block;\n }\n\n}\n\n#menu-to-edit {\n\n .menu-item {\n\n p.description-wide {\n\n position: relative;\n\n }\n\n .nav_item_options-roles {\n label {\n width: 33%;\n display: inline-block;\n float: left;\n margin-top: 5px;\n }\n }\n\n &.show-insert-button {\n\n .jpum-user-codes {\n display: block;\n }\n\n }\n\n }\n\n}\n",".jpum-user-codes {\n display: none;\n position: absolute;\n right: 1px;\n bottom: 1px;\n}\n\n.jpum-user-codes > button {\n border: 1px solid;\n border-radius: 2px;\n background-color: #23282d;\n color: #eee;\n text-align: center;\n cursor: pointer;\n font-size: 22px;\n height: 22px;\n width: 22px;\n padding: 0;\n outline: 0;\n display: block;\n}\n\n.jpum-user-codes > button:focus {\n border-color: #5b9dd9;\n box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);\n}\n\n.jpum-user-codes > button .dashicons {\n width: 20px;\n height: 20px;\n font-size: 20px;\n}\n\n.jpum-user-codes:hover > button {\n background-color: #0073aa;\n color: #fff;\n}\n\n.jpum-user-codes ul {\n display: none;\n position: absolute;\n top: 1px;\n left: 20px;\n background-color: #fff;\n width: auto;\n z-index: 999;\n /*box-shadow: 1px 1px 5px -1px; */\n}\n\n.jpum-user-codes ul li {\n display: block;\n border-bottom: 1px dashed rgba(0, 0, 0, 0.25);\n background-color: #23282d;\n}\n\n.jpum-user-codes ul li > a {\n color: #eee;\n cursor: pointer;\n line-height: 1;\n white-space: nowrap;\n text-decoration: none;\n display: block;\n padding: .5em;\n}\n\n.jpum-user-codes ul li > a:focus {\n color: #0073aa;\n border: 0;\n box-shadow: none;\n}\n\n.jpum-user-codes ul li:last-child {\n border-bottom: 0;\n}\n\n.jpum-user-codes ul li:hover {\n background-color: #0073aa;\n}\n\n.jpum-user-codes ul li:hover > a {\n color: #fff;\n}\n\n.jpum-user-codes.open ul {\n display: block;\n}\n\n#menu-to-edit .menu-item p.description-wide {\n position: relative;\n}\n\n#menu-to-edit .menu-item .nav_item_options-roles label {\n width: 33%;\n display: inline-block;\n float: left;\n margin-top: 5px;\n}\n\n#menu-to-edit .menu-item.show-insert-button .jpum-user-codes {\n display: block;\n}\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRtaW4uY3NzIiwic291cmNlcyI6WyJhZG1pbi5zY3NzIl0sInNvdXJjZXNDb250ZW50IjpbIi5qcHVtLXVzZXItY29kZXMge1xuXG4gIGRpc3BsYXk6IG5vbmU7XG5cbiAgcG9zaXRpb246IGFic29sdXRlO1xuICByaWdodDogMXB4O1xuICBib3R0b206IDFweDtcblxuICA+IGJ1dHRvbiB7XG4gICAgYm9yZGVyOiAxcHggc29saWQ7XG4gICAgYm9yZGVyLXJhZGl1czogMnB4O1xuICAgIGJhY2tncm91bmQtY29sb3I6ICMyMzI4MmQ7XG4gICAgY29sb3I6ICNlZWU7XG4gICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICBmb250LXNpemU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lY29yYXRpb246IG5vbmU7XG4gICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICBwYWRkaW5nOiAuNWVtO1xuXG4gICAgICAgICY6Zm9jdXMge1xuICAgICAgICAgIGNvbG9yOiAjMDA3M2FhO1xuICAgICAgICAgIGJvcmRlcjogMDtcbiAgICAgICAgICBib3gtc2hhZG93OiBub25lO1xuXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgJjpsYXN0LWNoaWxkIHtcbiAgICAgICAgYm9yZGVyLWJvdHRvbTogMDtcbiAgICAgIH1cblxuICAgICAgJjpob3ZlciB7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6ICMwMDczYWE7XG5cbiAgICAgICAgPiBhIHtcbiAgICAgICAgICBjb2xvcjogI2ZmZjtcblxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICB9XG5cbiAgfVxuXG4gICYub3BlbiB1bCB7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gIH1cblxufVxuXG4jbWVudS10by1lZGl0IHtcblxuICAubWVudS1pdGVtIHtcblxuICAgIHAuZGVzY3JpcHRpb24td2lkZSB7XG5cbiAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcblxuICAgIH1cblxuICAgIC5uYXZfaXRlbV9vcHRpb25zLXJvbGVzIHtcbiAgICAgIGxhYmVsIHtcbiAgICAgICAgd2lkdGg6IDMzJTtcbiAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgICAgICBmbG9hdDogbGVmdDtcbiAgICAgICAgbWFyZ2luLXRvcDogNXB4O1xuICAgICAgfVxuICAgIH1cblxuICAgICYuc2hvdy1pbnNlcnQtYnV0dG9uIHtcblxuICAgICAgLmpwdW0tdXNlci1jb2RlcyB7XG4gICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgfVxuXG4gICAgfVxuXG4gIH1cblxufVxuIl0sIm1hcHBpbmdzIjoiQUFBQSxBQUFBLGdCQUFnQixDQUFDO0VBRWYsT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FFLENBV0EsRUFBRSxBQTBCQyxNQUFNLEdBR0gsQ0FBQyxDQUFDO0VBQ0YsS0FBSyxFQUFFLElBQUs7Q0FFYjs7QUFsRlQsQUF5RlMsZ0JBekZPLEFBeUZiLEtBQUssQ0FBQyxFQUFFLENBQUM7RUFDUixPQUFPLEVBQUUsS0FBTTtDQUNoQjs7QUFJSCxBQUlLLGFBSlEsQ0FFWCxVQUFVLENBRVIsQ0FBQyxBQUFBLGlCQUFpQixDQUFDO0VBRWpCLFFBQVEsRUFBRSxRQUFTO0NBRXBCOztBQVJMLEFBV00sYUFYTyxDQUVYLFVBQVUsQ0FRUix1QkFBdUIsQ0FDckIsS0FBSyxDQUFDO0VBQ0osS0FBSyxFQUFFLEdBQUk7RUFDWCxPQUFPLEVBQUUsWUFBYTtFQUN0QixLQUFLLEVBQUUsSUFBSztFQUNaLFVBQVUsRUFBRSxHQUFJO0NBQ2pCOztBQWhCUCxBQXFCTSxhQXJCTyxDQUVYLFVBQVUsQUFpQlAsbUJBQW1CLENBRWxCLGdCQUFnQixDQUFDO0VBQ2YsT0FBTyxFQUFFLEtBQU07Q0FDaEIiLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9 */\n"],"sourceRoot":"/source/"}
|
assets/styles/admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.jpum-user-codes{display:none;position:absolute;right:
|
1 |
+
.jpum-user-codes{display:none;position:absolute;right:1px;bottom:1px}.jpum-user-codes>button{border:1px solid;border-radius:2px;background-color:#23282d;color:#eee;text-align:center;cursor:pointer;font-size:22px;height:22px;width:22px;padding:0;outline:0;display:block}.jpum-user-codes>button:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.jpum-user-codes>button .dashicons{width:20px;height:20px;font-size:20px}.jpum-user-codes:hover>button{background-color:#0073aa;color:#fff}.jpum-user-codes ul{display:none;position:absolute;top:1px;left:20px;background-color:#fff;width:auto;z-index:999}.jpum-user-codes ul li{display:block;border-bottom:1px dashed rgba(0,0,0,.25);background-color:#23282d}.jpum-user-codes ul li>a{color:#eee;cursor:pointer;line-height:1;white-space:nowrap;text-decoration:none;display:block;padding:.5em}.jpum-user-codes ul li>a:focus{color:#0073aa;border:0;box-shadow:none}.jpum-user-codes ul li:last-child{border-bottom:0}.jpum-user-codes ul li:hover{background-color:#0073aa}.jpum-user-codes ul li:hover>a{color:#fff}#menu-to-edit .menu-item.show-insert-button .jpum-user-codes,.jpum-user-codes.open ul{display:block}#menu-to-edit .menu-item p.description-wide{position:relative}#menu-to-edit .menu-item .nav_item_options-roles label{width:33%;display:inline-block;float:left;margin-top:5px}
|
assets/styles/sass/admin.scss
CHANGED
@@ -3,22 +3,38 @@
|
|
3 |
display: none;
|
4 |
|
5 |
position: absolute;
|
6 |
-
right:
|
7 |
-
bottom:
|
8 |
-
|
9 |
-
> span {
|
10 |
|
|
|
11 |
border: 1px solid;
|
12 |
border-radius: 2px;
|
13 |
-
background-color:
|
14 |
-
color: #
|
15 |
text-align: center;
|
16 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
ul {
|
@@ -26,29 +42,47 @@
|
|
26 |
|
27 |
position: absolute;
|
28 |
top: 1px;
|
29 |
-
left:
|
30 |
background-color: #fff;
|
31 |
width: auto;
|
32 |
z-index: 999;
|
33 |
-
box-shadow: 1px 1px 5px -1px;
|
34 |
-
border: 1px solid rgba(0, 0, 0, .25);
|
35 |
|
36 |
li {
|
37 |
-
|
38 |
display: block;
|
39 |
-
padding: .5em;
|
40 |
border-bottom: 1px dashed rgba(0, 0, 0, .25);
|
|
|
41 |
|
42 |
-
|
|
|
43 |
cursor: pointer;
|
44 |
-
display: block;
|
45 |
line-height: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
|
48 |
&:last-child {
|
49 |
border-bottom: 0;
|
50 |
}
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
}
|
3 |
display: none;
|
4 |
|
5 |
position: absolute;
|
6 |
+
right: 1px;
|
7 |
+
bottom: 1px;
|
|
|
|
|
8 |
|
9 |
+
> button {
|
10 |
border: 1px solid;
|
11 |
border-radius: 2px;
|
12 |
+
background-color: #23282d;
|
13 |
+
color: #eee;
|
14 |
text-align: center;
|
15 |
cursor: pointer;
|
16 |
+
font-size: 22px;
|
17 |
+
height: 22px;
|
18 |
+
width: 22px;
|
19 |
+
padding: 0;
|
20 |
+
outline: 0;
|
21 |
+
display: block;
|
22 |
|
23 |
+
&:focus {
|
24 |
+
border-color: #5b9dd9;
|
25 |
+
box-shadow: 0 0 2px rgba( 30, 140, 190, 0.8 );
|
26 |
+
}
|
27 |
|
28 |
+
.dashicons {
|
29 |
+
width: 20px;
|
30 |
+
height: 20px;
|
31 |
+
font-size: 20px;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
|
35 |
+
&:hover > button {
|
36 |
+
background-color: #0073aa;
|
37 |
+
color: #fff;
|
38 |
}
|
39 |
|
40 |
ul {
|
42 |
|
43 |
position: absolute;
|
44 |
top: 1px;
|
45 |
+
left: 20px;
|
46 |
background-color: #fff;
|
47 |
width: auto;
|
48 |
z-index: 999;
|
49 |
+
/*box-shadow: 1px 1px 5px -1px; */
|
|
|
50 |
|
51 |
li {
|
|
|
52 |
display: block;
|
|
|
53 |
border-bottom: 1px dashed rgba(0, 0, 0, .25);
|
54 |
+
background-color: #23282d;
|
55 |
|
56 |
+
> a {
|
57 |
+
color: #eee;
|
58 |
cursor: pointer;
|
|
|
59 |
line-height: 1;
|
60 |
+
white-space: nowrap;
|
61 |
+
text-decoration: none;
|
62 |
+
display: block;
|
63 |
+
padding: .5em;
|
64 |
+
|
65 |
+
&:focus {
|
66 |
+
color: #0073aa;
|
67 |
+
border: 0;
|
68 |
+
box-shadow: none;
|
69 |
+
|
70 |
+
}
|
71 |
}
|
72 |
|
73 |
&:last-child {
|
74 |
border-bottom: 0;
|
75 |
}
|
76 |
|
77 |
+
&:hover {
|
78 |
+
background-color: #0073aa;
|
79 |
+
|
80 |
+
> a {
|
81 |
+
color: #fff;
|
82 |
+
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
}
|
87 |
|
88 |
}
|
includes/classes/admin/menu-editor.php
CHANGED
@@ -151,10 +151,16 @@ class Menu_Editor {
|
|
151 |
public static function media_templates() { ?>
|
152 |
<script type="text/html" id="tmpl-jpum-user-codes">
|
153 |
<div class="jpum-user-codes">
|
154 |
-
<
|
|
|
|
|
155 |
<ul>
|
156 |
-
<?php foreach( Codes::valid_codes() as $code ) : ?>
|
157 |
-
<li
|
|
|
|
|
|
|
|
|
158 |
<?php endforeach; ?>
|
159 |
</ul>
|
160 |
</div>
|
151 |
public static function media_templates() { ?>
|
152 |
<script type="text/html" id="tmpl-jpum-user-codes">
|
153 |
<div class="jpum-user-codes">
|
154 |
+
<button type="button" title="<?php _e( 'Insert User Menu Codes', 'user-menus' ); ?>">
|
155 |
+
<i class="dashicons dashicons-arrow-left"></i>
|
156 |
+
</button>
|
157 |
<ul>
|
158 |
+
<?php foreach ( Codes::valid_codes() as $code => $label ) : ?>
|
159 |
+
<li>
|
160 |
+
<a title="<?php echo $label; ?>" href="#" data-code="<?php echo $code; ?>">
|
161 |
+
<?php echo $label; ?>
|
162 |
+
</a>
|
163 |
+
</li>
|
164 |
<?php endforeach; ?>
|
165 |
</ul>
|
166 |
</div>
|
includes/classes/admin/menu-settings.php
CHANGED
@@ -31,7 +31,23 @@ class Menu_Settings {
|
|
31 |
|
32 |
$allowed_user_roles = static::allowed_user_roles();
|
33 |
|
34 |
-
wp_nonce_field( 'jpum-menu-editor-nonce', 'jpum-menu-editor-nonce' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
if ( in_array( $item->object, array( 'login', 'logout' ) ) ) :
|
37 |
|
@@ -45,7 +61,7 @@ class Menu_Settings {
|
|
45 |
|
46 |
<label for="jp_nav_item_options-redirect_type-<?php echo $item->ID; ?>">
|
47 |
|
48 |
-
<?php _e( 'Where should users be taken afterwards?', 'user-menus' ); ?><br/>
|
49 |
|
50 |
<select name="jp_nav_item_options[<?php echo $item->ID; ?>][redirect_type]" id="jp_nav_item_options-redirect_type-<?php echo $item->ID; ?>" class="widefat">
|
51 |
<?php foreach ( $redirect_types as $option => $label ) : ?>
|
@@ -63,9 +79,9 @@ class Menu_Settings {
|
|
63 |
|
64 |
<label for="jp_nav_item_options-redirect_url-<?php echo $item->ID; ?>">
|
65 |
|
66 |
-
<?php _e( 'Enter a url user should be redirected to', 'user-menus' ); ?><br/>
|
67 |
|
68 |
-
<input type="text" name="jp_nav_item_options[<?php echo $item->ID; ?>][redirect_url]" id="jp_nav_item_options-redirect_url-<?php echo $item->ID; ?>" value="<?php esc_attr_e( $item->redirect_url ); ?>"
|
69 |
|
70 |
</label>
|
71 |
|
@@ -83,7 +99,7 @@ class Menu_Settings {
|
|
83 |
|
84 |
<label for="jp_nav_item_options-which_users-<?php echo $item->ID; ?>">
|
85 |
|
86 |
-
<?php _e( 'Who can see this link?', 'user-menus' ); ?><br/>
|
87 |
|
88 |
<select name="jp_nav_item_options[<?php echo $item->ID; ?>][which_users]" id="jp_nav_item_options-which_users-<?php echo $item->ID; ?>" class="widefat">
|
89 |
<?php foreach ( $which_users_options as $option => $label ) : ?>
|
@@ -99,7 +115,7 @@ class Menu_Settings {
|
|
99 |
|
100 |
<p class="nav_item_options-roles description description-wide">
|
101 |
|
102 |
-
<?php _e( 'Choose which roles can see this link', 'user-menus' ); ?><br/>
|
103 |
|
104 |
<?php foreach ( $allowed_user_roles as $option => $label ) : ?>
|
105 |
<label>
|
@@ -132,6 +148,10 @@ class Menu_Settings {
|
|
132 |
return $roles;
|
133 |
}
|
134 |
|
|
|
|
|
|
|
|
|
135 |
public static function save( $menu_id, $item_id ) {
|
136 |
|
137 |
$allowed_roles = static::allowed_user_roles();
|
31 |
|
32 |
$allowed_user_roles = static::allowed_user_roles();
|
33 |
|
34 |
+
wp_nonce_field( 'jpum-menu-editor-nonce', 'jpum-menu-editor-nonce' ); ?>
|
35 |
+
|
36 |
+
<p class="nav_item_options-avatar_size description description-wide">
|
37 |
+
|
38 |
+
<label for="jp_nav_item_options-avatar_size-<?php echo $item->ID; ?>">
|
39 |
+
|
40 |
+
<?php _e( 'Avatar Size', 'user-menus' ); ?><br />
|
41 |
+
|
42 |
+
<input type="number" min="0" step="1" name="jp_nav_item_options[<?php echo $item->ID; ?>][avatar_size]" id="jp_nav_item_options-avatar_size-<?php echo $item->ID; ?>" value="<?php esc_attr_e( $item->avatar_size ); ?>" class="widefat code" />
|
43 |
+
|
44 |
+
</label>
|
45 |
+
|
46 |
+
</p>
|
47 |
+
|
48 |
+
|
49 |
+
<?php
|
50 |
+
|
51 |
|
52 |
if ( in_array( $item->object, array( 'login', 'logout' ) ) ) :
|
53 |
|
61 |
|
62 |
<label for="jp_nav_item_options-redirect_type-<?php echo $item->ID; ?>">
|
63 |
|
64 |
+
<?php _e( 'Where should users be taken afterwards?', 'user-menus' ); ?><br />
|
65 |
|
66 |
<select name="jp_nav_item_options[<?php echo $item->ID; ?>][redirect_type]" id="jp_nav_item_options-redirect_type-<?php echo $item->ID; ?>" class="widefat">
|
67 |
<?php foreach ( $redirect_types as $option => $label ) : ?>
|
79 |
|
80 |
<label for="jp_nav_item_options-redirect_url-<?php echo $item->ID; ?>">
|
81 |
|
82 |
+
<?php _e( 'Enter a url user should be redirected to', 'user-menus' ); ?><br />
|
83 |
|
84 |
+
<input type="text" name="jp_nav_item_options[<?php echo $item->ID; ?>][redirect_url]" id="jp_nav_item_options-redirect_url-<?php echo $item->ID; ?>" value="<?php esc_attr_e( $item->redirect_url ); ?>" class="widefat code" />
|
85 |
|
86 |
</label>
|
87 |
|
99 |
|
100 |
<label for="jp_nav_item_options-which_users-<?php echo $item->ID; ?>">
|
101 |
|
102 |
+
<?php _e( 'Who can see this link?', 'user-menus' ); ?><br />
|
103 |
|
104 |
<select name="jp_nav_item_options[<?php echo $item->ID; ?>][which_users]" id="jp_nav_item_options-which_users-<?php echo $item->ID; ?>" class="widefat">
|
105 |
<?php foreach ( $which_users_options as $option => $label ) : ?>
|
115 |
|
116 |
<p class="nav_item_options-roles description description-wide">
|
117 |
|
118 |
+
<?php _e( 'Choose which roles can see this link', 'user-menus' ); ?><br />
|
119 |
|
120 |
<?php foreach ( $allowed_user_roles as $option => $label ) : ?>
|
121 |
<label>
|
148 |
return $roles;
|
149 |
}
|
150 |
|
151 |
+
/**
|
152 |
+
* @param $menu_id
|
153 |
+
* @param $item_id
|
154 |
+
*/
|
155 |
public static function save( $menu_id, $item_id ) {
|
156 |
|
157 |
$allowed_roles = static::allowed_user_roles();
|
includes/classes/admin/reviews.php
ADDED
@@ -0,0 +1,479 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace JP\UM\Admin;
|
4 |
+
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
exit;
|
7 |
+
}
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class JP\UM\Admin\Reviews
|
11 |
+
*
|
12 |
+
* This class adds a review request system for your plugin or theme to the WP dashboard.
|
13 |
+
*
|
14 |
+
* @since 1.1.0
|
15 |
+
*/
|
16 |
+
class Reviews {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Tracking API Endpoint.
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
public static $api_url;
|
24 |
+
|
25 |
+
/**
|
26 |
+
*
|
27 |
+
*/
|
28 |
+
public static function init() {
|
29 |
+
add_action( 'init', array( __CLASS__, 'hooks' ) );
|
30 |
+
add_action( 'wp_ajax_jpum_review_action', array( __CLASS__, 'ajax_handler' ) );
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Hook into relevant WP actions.
|
35 |
+
*/
|
36 |
+
public static function hooks() {
|
37 |
+
if ( is_admin() && current_user_can( 'edit_posts' ) ) {
|
38 |
+
self::installed_on();
|
39 |
+
add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
|
40 |
+
add_action( 'network_admin_notices', array( __CLASS__, 'admin_notices' ) );
|
41 |
+
add_action( 'user_admin_notices', array( __CLASS__, 'admin_notices' ) );
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Get the install date for comparisons. Sets the date to now if none is found.
|
47 |
+
*
|
48 |
+
* @return false|string
|
49 |
+
*/
|
50 |
+
public static function installed_on() {
|
51 |
+
$installed_on = get_option( 'jpum_reviews_installed_on', false );
|
52 |
+
|
53 |
+
if ( ! $installed_on ) {
|
54 |
+
$installed_on = current_time( 'mysql' );
|
55 |
+
update_option( 'jpum_reviews_installed_on', $installed_on );
|
56 |
+
}
|
57 |
+
|
58 |
+
return $installed_on;
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* AJAX Handler
|
63 |
+
*/
|
64 |
+
public static function ajax_handler() {
|
65 |
+
$args = wp_parse_args( $_REQUEST, array(
|
66 |
+
'group' => self::get_trigger_group(),
|
67 |
+
'code' => self::get_trigger_code(),
|
68 |
+
'pri' => self::get_current_trigger( 'pri' ),
|
69 |
+
'reason' => 'maybe_later',
|
70 |
+
) );
|
71 |
+
|
72 |
+
if ( ! wp_verify_nonce( $_REQUEST['nonce'], 'jpum_review_action' ) ) {
|
73 |
+
wp_send_json_error();
|
74 |
+
}
|
75 |
+
|
76 |
+
try {
|
77 |
+
$user_id = get_current_user_id();
|
78 |
+
|
79 |
+
$dismissed_triggers = self::dismissed_triggers();
|
80 |
+
$dismissed_triggers[ $args['group'] ] = $args['pri'];
|
81 |
+
update_user_meta( $user_id, '_jpum_reviews_dismissed_triggers', $dismissed_triggers );
|
82 |
+
update_user_meta( $user_id, '_jpum_reviews_last_dismissed', current_time( 'mysql' ) );
|
83 |
+
|
84 |
+
switch ( $args['reason'] ) {
|
85 |
+
case 'maybe_later':
|
86 |
+
update_user_meta( $user_id, '_jpum_reviews_last_dismissed', current_time( 'mysql' ) );
|
87 |
+
break;
|
88 |
+
case 'am_now':
|
89 |
+
case 'already_did':
|
90 |
+
self::already_did( true );
|
91 |
+
break;
|
92 |
+
}
|
93 |
+
|
94 |
+
wp_send_json_success();
|
95 |
+
|
96 |
+
} catch ( \Exception $e ) {
|
97 |
+
wp_send_json_error( $e );
|
98 |
+
}
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* @return int|string
|
103 |
+
*/
|
104 |
+
public static function get_trigger_group() {
|
105 |
+
static $selected;
|
106 |
+
|
107 |
+
if ( ! isset( $selected ) ) {
|
108 |
+
|
109 |
+
$dismissed_triggers = self::dismissed_triggers();
|
110 |
+
|
111 |
+
$triggers = self::triggers();
|
112 |
+
|
113 |
+
foreach ( $triggers as $g => $group ) {
|
114 |
+
foreach ( $group['triggers'] as $t => $trigger ) {
|
115 |
+
if ( ! in_array( false, $trigger['conditions'] ) && ( empty( $dismissed_triggers[ $g ] ) || $dismissed_triggers[ $g ] < $trigger['pri'] ) ) {
|
116 |
+
$selected = $g;
|
117 |
+
break;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
if ( isset( $selected ) ) {
|
122 |
+
break;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
return $selected;
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* @return int|string
|
132 |
+
*/
|
133 |
+
public static function get_trigger_code() {
|
134 |
+
static $selected;
|
135 |
+
|
136 |
+
if ( ! isset( $selected ) ) {
|
137 |
+
|
138 |
+
$dismissed_triggers = self::dismissed_triggers();
|
139 |
+
|
140 |
+
foreach ( self::triggers() as $g => $group ) {
|
141 |
+
foreach ( $group['triggers'] as $t => $trigger ) {
|
142 |
+
if ( ! in_array( false, $trigger['conditions'] ) && ( empty( $dismissed_triggers[ $g ] ) || $dismissed_triggers[ $g ] < $trigger['pri'] ) ) {
|
143 |
+
$selected = $t;
|
144 |
+
break;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( isset( $selected ) ) {
|
149 |
+
break;
|
150 |
+
}
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
return $selected;
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* @param null $key
|
159 |
+
*
|
160 |
+
* @return bool|mixed|void
|
161 |
+
*/
|
162 |
+
public static function get_current_trigger( $key = null ) {
|
163 |
+
$group = self::get_trigger_group();
|
164 |
+
$code = self::get_trigger_code();
|
165 |
+
|
166 |
+
if ( ! $group || ! $code ) {
|
167 |
+
return false;
|
168 |
+
}
|
169 |
+
|
170 |
+
$trigger = self::triggers( $group, $code );
|
171 |
+
|
172 |
+
return empty( $key ) ? $trigger : ( isset( $trigger[ $key ] ) ? $trigger[ $key ] : false );
|
173 |
+
}
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Returns an array of dismissed trigger groups.
|
177 |
+
*
|
178 |
+
* Array contains the group key and highest priority trigger that has been shown previously for each group.
|
179 |
+
*
|
180 |
+
* $return = array(
|
181 |
+
* 'group1' => 20
|
182 |
+
* );
|
183 |
+
*
|
184 |
+
* @return array|mixed
|
185 |
+
*/
|
186 |
+
public static function dismissed_triggers() {
|
187 |
+
$user_id = get_current_user_id();
|
188 |
+
|
189 |
+
$dismissed_triggers = get_user_meta( $user_id, '_jpum_reviews_dismissed_triggers', true );
|
190 |
+
|
191 |
+
if ( ! $dismissed_triggers ) {
|
192 |
+
$dismissed_triggers = array();
|
193 |
+
}
|
194 |
+
|
195 |
+
return $dismissed_triggers;
|
196 |
+
}
|
197 |
+
|
198 |
+
/**
|
199 |
+
* Returns true if the user has opted to never see this again. Or sets the option.
|
200 |
+
*
|
201 |
+
* @param bool $set If set this will mark the user as having opted to never see this again.
|
202 |
+
*
|
203 |
+
* @return bool
|
204 |
+
*/
|
205 |
+
public static function already_did( $set = false ) {
|
206 |
+
$user_id = get_current_user_id();
|
207 |
+
|
208 |
+
if ( $set ) {
|
209 |
+
update_user_meta( $user_id, '_jpum_reviews_already_did', true );
|
210 |
+
|
211 |
+
return true;
|
212 |
+
}
|
213 |
+
|
214 |
+
return (bool) get_user_meta( $user_id, '_jpum_reviews_already_did', true );
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Gets a list of triggers.
|
219 |
+
*
|
220 |
+
* @param null $group
|
221 |
+
* @param null $code
|
222 |
+
*
|
223 |
+
* @return bool|mixed|void
|
224 |
+
*/
|
225 |
+
public static function triggers( $group = null, $code = null ) {
|
226 |
+
static $triggers;
|
227 |
+
|
228 |
+
if ( ! isset( $triggers ) ) {
|
229 |
+
|
230 |
+
$time_message = __( 'Hi there! You\'ve been using the User Menus plugin on your site for %s now - We hope it\'s been helpful. If you\'re enjoying the plugin, would you mind rating it 5-stars to help spread the word?', 'user-menus' );
|
231 |
+
$triggers = array(
|
232 |
+
'time_installed' => array(
|
233 |
+
'triggers' => array(
|
234 |
+
'one_week' => array(
|
235 |
+
'message' => sprintf( $time_message, __( '2 weeks', 'user-menus' ) ),
|
236 |
+
'conditions' => array(
|
237 |
+
strtotime( self::installed_on() . ' +2 weeks' ) < time(),
|
238 |
+
),
|
239 |
+
'link' => 'https://wordpress.org/support/plugin/user-menus/reviews/?rate=5#rate-response',
|
240 |
+
'pri' => 10,
|
241 |
+
),
|
242 |
+
'three_months' => array(
|
243 |
+
'message' => sprintf( $time_message, __( '3 months', 'user-menus' ) ),
|
244 |
+
'conditions' => array(
|
245 |
+
strtotime( self::installed_on() . ' +3 months' ) < time(),
|
246 |
+
),
|
247 |
+
'link' => 'https://wordpress.org/support/plugin/user-menus/reviews/?rate=5#rate-response',
|
248 |
+
'pri' => 20,
|
249 |
+
),
|
250 |
+
|
251 |
+
),
|
252 |
+
'pri' => 10,
|
253 |
+
),
|
254 |
+
);
|
255 |
+
|
256 |
+
$triggers = apply_filters( 'jpum_reviews_triggers', $triggers );
|
257 |
+
|
258 |
+
// Sort Groups
|
259 |
+
uasort( $triggers, array( __CLASS__, 'rsort_by_priority' ) );
|
260 |
+
|
261 |
+
// Sort each groups triggers.
|
262 |
+
foreach ( $triggers as $k => $v ) {
|
263 |
+
uasort( $triggers[ $k ]['triggers'], array( __CLASS__, 'rsort_by_priority' ) );
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
if ( isset( $group ) ) {
|
268 |
+
if ( ! isset( $triggers[ $group ] ) ) {
|
269 |
+
return false;
|
270 |
+
}
|
271 |
+
|
272 |
+
return ! isset( $code ) ? $triggers[ $group ] : isset( $triggers[ $group ]['triggers'][ $code ] ) ? $triggers[ $group ]['triggers'][ $code ] : false;
|
273 |
+
}
|
274 |
+
|
275 |
+
return $triggers;
|
276 |
+
}
|
277 |
+
|
278 |
+
/**
|
279 |
+
* Render admin notices if available.
|
280 |
+
*/
|
281 |
+
public static function admin_notices() {
|
282 |
+
if ( self::hide_notices() ) {
|
283 |
+
return;
|
284 |
+
}
|
285 |
+
|
286 |
+
$group = self::get_trigger_group();
|
287 |
+
$code = self::get_trigger_code();
|
288 |
+
$pri = self::get_current_trigger( 'pri' );
|
289 |
+
$trigger = self::get_current_trigger();
|
290 |
+
|
291 |
+
// Used to anonymously distinguish unique site+user combinations in terms of effectiveness of each trigger.
|
292 |
+
$uuid = wp_hash( home_url() . '-' . get_current_user_id() );
|
293 |
+
|
294 |
+
?>
|
295 |
+
|
296 |
+
<script type="text/javascript">
|
297 |
+
(function ($) {
|
298 |
+
var trigger = {
|
299 |
+
group: '<?php echo $group; ?>',
|
300 |
+
code: '<?php echo $code; ?>',
|
301 |
+
pri: '<?php echo $pri; ?>'
|
302 |
+
};
|
303 |
+
|
304 |
+
function dismiss(reason) {
|
305 |
+
$.ajax({
|
306 |
+
method: "POST",
|
307 |
+
dataType: "json",
|
308 |
+
url: ajaxurl,
|
309 |
+
data: {
|
310 |
+
action: 'jpum_review_action',
|
311 |
+
nonce: '<?php echo wp_create_nonce( 'jpum_review_action' ); ?>',
|
312 |
+
group: trigger.group,
|
313 |
+
code: trigger.code,
|
314 |
+
pri: trigger.pri,
|
315 |
+
reason: reason
|
316 |
+
}
|
317 |
+
});
|
318 |
+
|
319 |
+
<?php if ( ! empty( self::$api_url ) ) : ?>
|
320 |
+
$.ajax({
|
321 |
+
method: "POST",
|
322 |
+
dataType: "json",
|
323 |
+
url: '<?php echo self::$api_url; ?>',
|
324 |
+
data: {
|
325 |
+
trigger_group: trigger.group,
|
326 |
+
trigger_code: trigger.code,
|
327 |
+
reason: reason,
|
328 |
+
uuid: '<?php echo $uuid; ?>'
|
329 |
+
}
|
330 |
+
});
|
331 |
+
<?php endif; ?>
|
332 |
+
}
|
333 |
+
|
334 |
+
$(document)
|
335 |
+
.on('click', '.jpum-notice .jpum-dismiss', function (event) {
|
336 |
+
var $this = $(this),
|
337 |
+
reason = $this.data('reason'),
|
338 |
+
notice = $this.parents('.jpum-notice');
|
339 |
+
|
340 |
+
notice.fadeTo(100, 0, function () {
|
341 |
+
notice.slideUp(100, function () {
|
342 |
+
notice.remove();
|
343 |
+
});
|
344 |
+
});
|
345 |
+
|
346 |
+
dismiss(reason);
|
347 |
+
})
|
348 |
+
.ready(function () {
|
349 |
+
setTimeout(function () {
|
350 |
+
$('.jpum-notice button.notice-dismiss').click(function (event) {
|
351 |
+
dismiss('maybe_later');
|
352 |
+
});
|
353 |
+
}, 1000);
|
354 |
+
});
|
355 |
+
}(jQuery));
|
356 |
+
</script>
|
357 |
+
|
358 |
+
<style>
|
359 |
+
.jpum-notice p {
|
360 |
+
margin-bottom: 0;
|
361 |
+
}
|
362 |
+
|
363 |
+
.jpum-notice img.logo {
|
364 |
+
float: right;
|
365 |
+
margin-left: 10px;
|
366 |
+
width: 75px;
|
367 |
+
padding: 0.25em;
|
368 |
+
border: 1px solid #ccc;
|
369 |
+
}
|
370 |
+
</style>
|
371 |
+
|
372 |
+
<div class="notice notice-success is-dismissible jpum-notice">
|
373 |
+
|
374 |
+
<p>
|
375 |
+
<img class="logo" src="<?php echo \JP_User_Menus::$URL; ?>assets/images/icon-128x128.png" />
|
376 |
+
<strong>
|
377 |
+
<?php echo $trigger['message']; ?>
|
378 |
+
<br />
|
379 |
+
<?php
|
380 |
+
|
381 |
+
$names = array(
|
382 |
+
'<a target="_blank" href="https://twitter.com/danieliser" title="Follow Daniel on Twitter">@danieliser</a>',
|
383 |
+
'<a target="_blank" href="https://twitter.com/calumallison" title="Follow Calum on Twitter">@calumallison</a>',
|
384 |
+
);
|
385 |
+
|
386 |
+
shuffle( $names );
|
387 |
+
|
388 |
+
echo '~ ' . implode( ' & ', $names );
|
389 |
+
|
390 |
+
?>
|
391 |
+
</strong>
|
392 |
+
</p>
|
393 |
+
<ul>
|
394 |
+
<li>
|
395 |
+
<a class="jpum-dismiss" target="_blank" href="<?php echo $trigger['link']; ?>>" data-reason="am_now">
|
396 |
+
<strong><?php _e( 'Ok, you deserve it', 'user-menus' ); ?></strong>
|
397 |
+
</a>
|
398 |
+
</li>
|
399 |
+
<li>
|
400 |
+
<a href="#" class="jpum-dismiss" data-reason="maybe_later">
|
401 |
+
<?php _e( 'Nope, maybe later', 'user-menus' ); ?>
|
402 |
+
</a>
|
403 |
+
</li>
|
404 |
+
<li>
|
405 |
+
<a href="#" class="jpum-dismiss" data-reason="already_did">
|
406 |
+
<?php _e( 'I already did', 'user-menus' ); ?>
|
407 |
+
</a>
|
408 |
+
</li>
|
409 |
+
</ul>
|
410 |
+
|
411 |
+
</div>
|
412 |
+
|
413 |
+
<?php
|
414 |
+
}
|
415 |
+
|
416 |
+
/**
|
417 |
+
* Checks if notices should be shown.
|
418 |
+
*
|
419 |
+
* @return bool
|
420 |
+
*/
|
421 |
+
public static function hide_notices() {
|
422 |
+
$code = self::get_trigger_code();
|
423 |
+
|
424 |
+
$conditions = array(
|
425 |
+
self::already_did(),
|
426 |
+
self::last_dismissed() && strtotime( self::last_dismissed() . ' +2 weeks' ) > time(),
|
427 |
+
empty( $code ),
|
428 |
+
);
|
429 |
+
|
430 |
+
return in_array( true, $conditions );
|
431 |
+
}
|
432 |
+
|
433 |
+
/**
|
434 |
+
* Gets the last dismissed date.
|
435 |
+
*
|
436 |
+
* @return false|string
|
437 |
+
*/
|
438 |
+
public static function last_dismissed() {
|
439 |
+
$user_id = get_current_user_id();
|
440 |
+
|
441 |
+
return get_user_meta( $user_id, '_jpum_reviews_last_dismissed', true );
|
442 |
+
}
|
443 |
+
|
444 |
+
/**
|
445 |
+
* Sort array by priority value
|
446 |
+
*
|
447 |
+
* @param $a
|
448 |
+
* @param $b
|
449 |
+
*
|
450 |
+
* @return int
|
451 |
+
*/
|
452 |
+
public static function sort_by_priority( $a, $b ) {
|
453 |
+
if ( ! isset( $a['pri'] ) || ! isset( $b['pri'] ) || $a['pri'] === $b['pri'] ) {
|
454 |
+
return 0;
|
455 |
+
}
|
456 |
+
|
457 |
+
return ( $a['pri'] < $b['pri'] ) ? - 1 : 1;
|
458 |
+
}
|
459 |
+
|
460 |
+
/**
|
461 |
+
* Sort array in reverse by priority value
|
462 |
+
*
|
463 |
+
* @param $a
|
464 |
+
* @param $b
|
465 |
+
*
|
466 |
+
* @return int
|
467 |
+
*/
|
468 |
+
public static function rsort_by_priority( $a, $b ) {
|
469 |
+
if ( ! isset( $a['pri'] ) || ! isset( $b['pri'] ) || $a['pri'] === $b['pri'] ) {
|
470 |
+
return 0;
|
471 |
+
}
|
472 |
+
|
473 |
+
return ( $a['pri'] < $b['pri'] ) ? 1 : - 1;
|
474 |
+
}
|
475 |
+
|
476 |
+
}
|
477 |
+
|
478 |
+
Reviews::init();
|
479 |
+
|
includes/classes/menu/item.php
CHANGED
@@ -36,6 +36,7 @@ class Item {
|
|
36 |
}
|
37 |
|
38 |
return wp_parse_args( $options, array(
|
|
|
39 |
'redirect_type' => 'current',
|
40 |
'redirect_url' => '',
|
41 |
'which_users' => '',
|
36 |
}
|
37 |
|
38 |
return wp_parse_args( $options, array(
|
39 |
+
'avatar_size' => 24,
|
40 |
'redirect_type' => 'current',
|
41 |
'redirect_url' => '',
|
42 |
'which_users' => '',
|
includes/classes/menu/items.php
CHANGED
@@ -13,6 +13,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
13 |
*/
|
14 |
class Items {
|
15 |
|
|
|
|
|
16 |
/**
|
17 |
* Init
|
18 |
*/
|
@@ -29,6 +31,8 @@ class Items {
|
|
29 |
*/
|
30 |
public static function merge_item_data( $item ) {
|
31 |
|
|
|
|
|
32 |
// Merge Rules.
|
33 |
foreach ( Item::get_options( $item->ID ) as $key => $value ) {
|
34 |
$item->$key = $value;
|
@@ -124,7 +128,7 @@ class Items {
|
|
124 |
|
125 |
foreach ( $matches as $string ) {
|
126 |
|
127 |
-
if ( $current_user->ID == 0
|
128 |
|
129 |
$replace = '';
|
130 |
|
@@ -132,6 +136,10 @@ class Items {
|
|
132 |
|
133 |
switch ( $string ) {
|
134 |
|
|
|
|
|
|
|
|
|
135 |
case 'first_name':
|
136 |
$replace = $current_user->user_firstname;
|
137 |
break;
|
13 |
*/
|
14 |
class Items {
|
15 |
|
16 |
+
private static $current_item;
|
17 |
+
|
18 |
/**
|
19 |
* Init
|
20 |
*/
|
31 |
*/
|
32 |
public static function merge_item_data( $item ) {
|
33 |
|
34 |
+
self::$current_item = $item;
|
35 |
+
|
36 |
// Merge Rules.
|
37 |
foreach ( Item::get_options( $item->ID ) as $key => $value ) {
|
38 |
$item->$key = $value;
|
128 |
|
129 |
foreach ( $matches as $string ) {
|
130 |
|
131 |
+
if ( $current_user->ID == 0 || ! array_key_exists( $string, Codes::valid_codes() ) ) {
|
132 |
|
133 |
$replace = '';
|
134 |
|
136 |
|
137 |
switch ( $string ) {
|
138 |
|
139 |
+
case 'avatar':
|
140 |
+
$replace = get_avatar( $current_user, self::$current_item->avatar_size );
|
141 |
+
break;
|
142 |
+
|
143 |
case 'first_name':
|
144 |
$replace = $current_user->user_firstname;
|
145 |
break;
|
includes/classes/user/codes.php
CHANGED
@@ -16,12 +16,13 @@ class Codes {
|
|
16 |
*/
|
17 |
public static function valid_codes() {
|
18 |
return array(
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
|
|
25 |
);
|
26 |
}
|
27 |
|
16 |
*/
|
17 |
public static function valid_codes() {
|
18 |
return array(
|
19 |
+
'avatar' => __( 'Avatar', 'user-menus' ),
|
20 |
+
'first_name' => __( 'First Name', 'user-menus' ),
|
21 |
+
'last_name' => __( 'Last Name', 'user-menus' ),
|
22 |
+
'username' => __( 'Username', 'user-menus' ),
|
23 |
+
'display_name' => __( 'Display Name', 'user-menus' ),
|
24 |
+
'nickname' => __( 'Nickname', 'user-menus' ),
|
25 |
+
'email' => __( 'Email', 'user-menus' ),
|
26 |
);
|
27 |
}
|
28 |
|
languages/user-menus.pot
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the user-menus package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
@@ -7,7 +7,7 @@ msgstr ""
|
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
-
"PO-Revision-Date:
|
11 |
"Language-Team: Daniel Iser <danieliser@wizardinternetsolutions.com>\n"
|
12 |
"X-Poedit-Basepath: ..\n"
|
13 |
"X-Poedit-SourceCharset: UTF-8\n"
|
@@ -40,46 +40,74 @@ msgstr ""
|
|
40 |
msgid "Import nav menus and other menu item meta skipped by the default importer"
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: includes/classes/admin/menu-settings.php:
|
|
|
|
|
|
|
|
|
44 |
msgid "Current Page"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: includes/classes/admin/menu-settings.php:
|
48 |
msgid "Home Page"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: includes/classes/admin/menu-settings.php:
|
52 |
msgid "Custom URL"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: includes/classes/admin/menu-settings.php:
|
56 |
msgid "Where should users be taken afterwards?"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: includes/classes/admin/menu-settings.php:
|
60 |
msgid "Enter a url user should be redirected to"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: includes/classes/admin/menu-settings.php:
|
64 |
msgid "Everyone"
|
65 |
msgstr ""
|
66 |
|
67 |
-
#: includes/classes/admin/menu-settings.php:
|
68 |
msgid "Logged Out Users"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: includes/classes/admin/menu-settings.php:
|
72 |
msgid "Logged In Users"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: includes/classes/admin/menu-settings.php:
|
76 |
msgid "Who can see this link?"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: includes/classes/admin/menu-settings.php:
|
80 |
msgid "Choose which roles can see this link"
|
81 |
msgstr ""
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
#: includes/classes/importer/menu.php:97
|
84 |
msgid "Import Nav Menus"
|
85 |
msgstr ""
|
@@ -120,14 +148,42 @@ msgstr ""
|
|
120 |
msgid "Have fun!"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: includes/classes/menu/items.php:
|
124 |
msgid "User Link"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
msgid "The %4$s %1$s %5$s plugin requires %2$s version %3$s or greater."
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: user-menus.php:
|
132 |
msgid "Plugin Activation Error"
|
133 |
msgstr ""
|
1 |
+
# Copyright (C) 2017 user-menus
|
2 |
# This file is distributed under the same license as the user-menus package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
7 |
"MIME-Version: 1.0\n"
|
8 |
"Content-Type: text/plain; charset=UTF-8\n"
|
9 |
"Content-Transfer-Encoding: 8bit\n"
|
10 |
+
"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
|
11 |
"Language-Team: Daniel Iser <danieliser@wizardinternetsolutions.com>\n"
|
12 |
"X-Poedit-Basepath: ..\n"
|
13 |
"X-Poedit-SourceCharset: UTF-8\n"
|
40 |
msgid "Import nav menus and other menu item meta skipped by the default importer"
|
41 |
msgstr ""
|
42 |
|
43 |
+
#: includes/classes/admin/menu-settings.php:40
|
44 |
+
msgid "Avatar Size"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: includes/classes/admin/menu-settings.php:55
|
48 |
msgid "Current Page"
|
49 |
msgstr ""
|
50 |
|
51 |
+
#: includes/classes/admin/menu-settings.php:56
|
52 |
msgid "Home Page"
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: includes/classes/admin/menu-settings.php:57
|
56 |
msgid "Custom URL"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: includes/classes/admin/menu-settings.php:64
|
60 |
msgid "Where should users be taken afterwards?"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: includes/classes/admin/menu-settings.php:82
|
64 |
msgid "Enter a url user should be redirected to"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: includes/classes/admin/menu-settings.php:93
|
68 |
msgid "Everyone"
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: includes/classes/admin/menu-settings.php:94
|
72 |
msgid "Logged Out Users"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: includes/classes/admin/menu-settings.php:95
|
76 |
msgid "Logged In Users"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: includes/classes/admin/menu-settings.php:102
|
80 |
msgid "Who can see this link?"
|
81 |
msgstr ""
|
82 |
|
83 |
+
#: includes/classes/admin/menu-settings.php:118
|
84 |
msgid "Choose which roles can see this link"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: includes/classes/admin/reviews.php:230
|
88 |
+
msgid "Hi there! You've been using the User Menus plugin on your site for %s now - We hope it's been helpful. If you're enjoying the plugin, would you mind rating it 5-stars to help spread the word?"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: includes/classes/admin/reviews.php:235
|
92 |
+
msgid "2 weeks"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: includes/classes/admin/reviews.php:243
|
96 |
+
msgid "3 months"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: includes/classes/admin/reviews.php:396
|
100 |
+
msgid "Ok, you deserve it"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: includes/classes/admin/reviews.php:401
|
104 |
+
msgid "Nope, maybe later"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: includes/classes/admin/reviews.php:406
|
108 |
+
msgid "I already did"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
#: includes/classes/importer/menu.php:97
|
112 |
msgid "Import Nav Menus"
|
113 |
msgstr ""
|
148 |
msgid "Have fun!"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: includes/classes/menu/items.php:43
|
152 |
msgid "User Link"
|
153 |
msgstr ""
|
154 |
|
155 |
+
#: includes/classes/user/codes.php:19
|
156 |
+
msgid "Avatar"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: includes/classes/user/codes.php:20
|
160 |
+
msgid "First Name"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: includes/classes/user/codes.php:21
|
164 |
+
msgid "Last Name"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: includes/classes/user/codes.php:22
|
168 |
+
msgid "Username"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: includes/classes/user/codes.php:23
|
172 |
+
msgid "Display Name"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: includes/classes/user/codes.php:24
|
176 |
+
msgid "Nickname"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: includes/classes/user/codes.php:25
|
180 |
+
msgid "Email"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: user-menus.php:172
|
184 |
msgid "The %4$s %1$s %5$s plugin requires %2$s version %3$s or greater."
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: user-menus.php:174
|
188 |
msgid "Plugin Activation Error"
|
189 |
msgstr ""
|
readme.txt
CHANGED
@@ -1,21 +1,18 @@
|
|
1 |
=== User Menus ===
|
2 |
Contributors: jungleplugins, danieliser
|
3 |
-
Author URI:
|
4 |
Plugin URI: https://wordpress.org/plugins/user-menus/
|
5 |
-
Donate link:
|
6 |
Tags: menu, menus, user-menu, logout, nav-menu, nav-menus, user, user-role, user-roles
|
7 |
Requires at least: 3.6
|
8 |
-
Tested up to: 4.
|
9 |
-
Stable tag: 1.
|
10 |
Minimum PHP: 5.3
|
11 |
License: GNU Version 3 or Any Later Version
|
12 |
|
13 |
Show/hide menu items to logged in users, logged out users or specific user roles. Display logged in user details in menu. Add a logout link to menu.
|
14 |
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
== Description ==
|
20 |
|
21 |
User Menus by [Jungle Plugins][jungleplugins] is the perfect plugin for websites which have logged in users.
|
@@ -34,6 +31,7 @@ User Menus allows you to do the following:
|
|
34 |
* Display menu items to only logged out users
|
35 |
* Display menu items to only logged in users
|
36 |
* Display menu item to specific user roles
|
|
|
37 |
* Show a logged in user’s {username} in a menu item
|
38 |
* Show a logged in user’s {first_name} in a menu item
|
39 |
* Show a logged in user’s {last_name} in a menu item
|
@@ -64,10 +62,6 @@ If you’d like to get updates on our plugin development work you can [subscribe
|
|
64 |
|
65 |
[jungleplugins twitter]: https://twitter.com/jungleplugins/ "Jungle Plugins on Twitter"
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
== Installation ==
|
72 |
|
73 |
= Minimum Requirements =
|
@@ -87,8 +81,6 @@ If you need help getting started with User Menus please see [FAQs][faq page] whi
|
|
87 |
[faq page]: https://wordpress.org/plugins/user-menus/faq/ "User Menus FAQ"
|
88 |
|
89 |
|
90 |
-
|
91 |
-
|
92 |
== Frequently Asked Questions ==
|
93 |
|
94 |
= How do I setup this plugin? =
|
@@ -107,13 +99,9 @@ If you get stuck, you can ask for help in the [User Menu Plugin Forum][support f
|
|
107 |
Bugs can be reported either in our support forum or preferably on the [User Menu GitHub][github issues] repository (link to GitHub repo).
|
108 |
|
109 |
|
110 |
-
|
111 |
[github issues]: https://github.com/jungleplugins/user-menus/issues "GitHub Issue tracker for User Menus by Jungle Plugins"
|
112 |
|
113 |
-
[support forum]:
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
|
118 |
|
119 |
== Screenshots ==
|
@@ -123,9 +111,16 @@ Bugs can be reported either in our support forum or preferably on the [User Menu
|
|
123 |
3. Quickly insert login/logout links & choose where users will be taken afterwards.
|
124 |
|
125 |
|
|
|
126 |
|
|
|
|
|
127 |
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
-
== Changelog ==
|
130 |
= v1.0.0 =
|
131 |
* Initial Release
|
1 |
=== User Menus ===
|
2 |
Contributors: jungleplugins, danieliser
|
3 |
+
Author URI: https://jungleplugins.com/
|
4 |
Plugin URI: https://wordpress.org/plugins/user-menus/
|
5 |
+
Donate link: https://jungleplugins.com/donate/
|
6 |
Tags: menu, menus, user-menu, logout, nav-menu, nav-menus, user, user-role, user-roles
|
7 |
Requires at least: 3.6
|
8 |
+
Tested up to: 4.7.2
|
9 |
+
Stable tag: 1.1.1
|
10 |
Minimum PHP: 5.3
|
11 |
License: GNU Version 3 or Any Later Version
|
12 |
|
13 |
Show/hide menu items to logged in users, logged out users or specific user roles. Display logged in user details in menu. Add a logout link to menu.
|
14 |
|
15 |
|
|
|
|
|
|
|
16 |
== Description ==
|
17 |
|
18 |
User Menus by [Jungle Plugins][jungleplugins] is the perfect plugin for websites which have logged in users.
|
31 |
* Display menu items to only logged out users
|
32 |
* Display menu items to only logged in users
|
33 |
* Display menu item to specific user roles
|
34 |
+
* Show a logged in user’s {avatar} in a menu item with custom size option.
|
35 |
* Show a logged in user’s {username} in a menu item
|
36 |
* Show a logged in user’s {first_name} in a menu item
|
37 |
* Show a logged in user’s {last_name} in a menu item
|
62 |
|
63 |
[jungleplugins twitter]: https://twitter.com/jungleplugins/ "Jungle Plugins on Twitter"
|
64 |
|
|
|
|
|
|
|
|
|
65 |
== Installation ==
|
66 |
|
67 |
= Minimum Requirements =
|
81 |
[faq page]: https://wordpress.org/plugins/user-menus/faq/ "User Menus FAQ"
|
82 |
|
83 |
|
|
|
|
|
84 |
== Frequently Asked Questions ==
|
85 |
|
86 |
= How do I setup this plugin? =
|
99 |
Bugs can be reported either in our support forum or preferably on the [User Menu GitHub][github issues] repository (link to GitHub repo).
|
100 |
|
101 |
|
|
|
102 |
[github issues]: https://github.com/jungleplugins/user-menus/issues "GitHub Issue tracker for User Menus by Jungle Plugins"
|
103 |
|
104 |
+
[support forum]: https://wordpress.org/support/plugin/user-menus "User Menu Plugin Forum"
|
|
|
|
|
|
|
105 |
|
106 |
|
107 |
== Screenshots ==
|
111 |
3. Quickly insert login/logout links & choose where users will be taken afterwards.
|
112 |
|
113 |
|
114 |
+
== Changelog ==
|
115 |
|
116 |
+
= v1.1.1 =
|
117 |
+
* Fix: Forgot to add new files during commit. Correcting this issue.
|
118 |
|
119 |
+
= v1.1.0 =
|
120 |
+
* Feature: Added ability to insert user avatar in menu items with size option to match your needs.
|
121 |
+
* Improvement: Added accessibility enhancements to menu editor. Includes keyboard support, proper focus, tabbing & titles.
|
122 |
+
* Improvement: Added proper labeling to the user code dropdown.
|
123 |
+
* Tweak: Restyled user code insert elements to better resemble default WP admin.
|
124 |
|
|
|
125 |
= v1.0.0 =
|
126 |
* Initial Release
|
user-menus.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: User Menus
|
4 |
* Plugin URI: https://wordpress.org/plugins/user-menus/
|
5 |
* Description: Quickly customize & extend your menus with user based functionality.
|
6 |
-
* Version: 1.
|
7 |
* Author: Jungle Plugins
|
8 |
* Author URI: https://jungleplugins.com/
|
9 |
* Text Domain: user-menus
|
@@ -37,7 +37,7 @@ class JP_User_Menus {
|
|
37 |
/**
|
38 |
* @var string
|
39 |
*/
|
40 |
-
public static $VER = '1.
|
41 |
|
42 |
/**
|
43 |
* @var string
|
@@ -105,9 +105,9 @@ class JP_User_Menus {
|
|
105 |
* @return void
|
106 |
*/
|
107 |
private function setup_constants() {
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
}
|
112 |
|
113 |
/**
|
@@ -119,17 +119,18 @@ class JP_User_Menus {
|
|
119 |
*/
|
120 |
private function includes() {
|
121 |
// Menu Items
|
122 |
-
require_once
|
123 |
-
require_once
|
124 |
-
require_once
|
125 |
if ( is_admin() ) {
|
126 |
// Admin Menu Editor
|
127 |
-
require_once
|
128 |
-
require_once
|
129 |
-
require_once
|
|
|
130 |
} else {
|
131 |
// Site Menu Filter
|
132 |
-
require_once
|
133 |
}
|
134 |
}
|
135 |
|
@@ -155,20 +156,20 @@ class JP_User_Menus {
|
|
155 |
public static function activation_check() {
|
156 |
global $wp_version;
|
157 |
|
158 |
-
if ( version_compare( PHP_VERSION,
|
159 |
$flag = 'PHP';
|
160 |
-
} elseif ( version_compare( $wp_version,
|
161 |
$flag = 'WordPress';
|
162 |
} else {
|
163 |
return;
|
164 |
}
|
165 |
|
166 |
-
$version = 'PHP' == $flag ?
|
167 |
|
168 |
// Deactivate automatically due to insufficient PHP or WP Version.
|
169 |
deactivate_plugins( basename( __FILE__ ) );
|
170 |
|
171 |
-
$notice = sprintf( __( 'The %4$s %1$s %5$s plugin requires %2$s version %3$s or greater.', 'user-menus' ),
|
172 |
|
173 |
wp_die( "<p>$notice</p>", __( 'Plugin Activation Error', 'user-menus' ), array( 'response' => 200, 'back_link' => true, ) );
|
174 |
}
|
@@ -189,7 +190,7 @@ class JP_User_Menus {
|
|
189 |
* @return string
|
190 |
*/
|
191 |
public function template_path() {
|
192 |
-
return apply_filters( 'jpum_template_path',
|
193 |
}
|
194 |
|
195 |
/**
|
3 |
* Plugin Name: User Menus
|
4 |
* Plugin URI: https://wordpress.org/plugins/user-menus/
|
5 |
* Description: Quickly customize & extend your menus with user based functionality.
|
6 |
+
* Version: 1.1.1
|
7 |
* Author: Jungle Plugins
|
8 |
* Author URI: https://jungleplugins.com/
|
9 |
* Text Domain: user-menus
|
37 |
/**
|
38 |
* @var string
|
39 |
*/
|
40 |
+
public static $VER = '1.1.1';
|
41 |
|
42 |
/**
|
43 |
* @var string
|
105 |
* @return void
|
106 |
*/
|
107 |
private function setup_constants() {
|
108 |
+
self::$DIR = self::$instance->plugin_path();
|
109 |
+
self::$URL = self::$instance->plugin_url();
|
110 |
+
self::$FILE = __FILE__;
|
111 |
}
|
112 |
|
113 |
/**
|
119 |
*/
|
120 |
private function includes() {
|
121 |
// Menu Items
|
122 |
+
require_once self::$DIR . 'includes/classes/menu/item.php';
|
123 |
+
require_once self::$DIR . 'includes/classes/menu/items.php';
|
124 |
+
require_once self::$DIR . 'includes/classes/user/codes.php';
|
125 |
if ( is_admin() ) {
|
126 |
// Admin Menu Editor
|
127 |
+
require_once self::$DIR . 'includes/classes/admin/menu-editor.php';
|
128 |
+
require_once self::$DIR . 'includes/classes/admin/menu-settings.php';
|
129 |
+
require_once self::$DIR . 'includes/classes/admin/menu-importer.php';
|
130 |
+
require_once self::$DIR . 'includes/classes/admin/reviews.php';
|
131 |
} else {
|
132 |
// Site Menu Filter
|
133 |
+
require_once self::$DIR . 'includes/classes/site/menus.php';
|
134 |
}
|
135 |
}
|
136 |
|
156 |
public static function activation_check() {
|
157 |
global $wp_version;
|
158 |
|
159 |
+
if ( version_compare( PHP_VERSION, self::$MIN_PHP_VER, '<' ) ) {
|
160 |
$flag = 'PHP';
|
161 |
+
} elseif ( version_compare( $wp_version, self::$MIN_WP_VER, '<' ) ) {
|
162 |
$flag = 'WordPress';
|
163 |
} else {
|
164 |
return;
|
165 |
}
|
166 |
|
167 |
+
$version = 'PHP' == $flag ? self::$MIN_PHP_VER : self::$MIN_WP_VER;
|
168 |
|
169 |
// Deactivate automatically due to insufficient PHP or WP Version.
|
170 |
deactivate_plugins( basename( __FILE__ ) );
|
171 |
|
172 |
+
$notice = sprintf( __( 'The %4$s %1$s %5$s plugin requires %2$s version %3$s or greater.', 'user-menus' ), self::$NAME, $flag, $version, "<strong>", "</strong>" );
|
173 |
|
174 |
wp_die( "<p>$notice</p>", __( 'Plugin Activation Error', 'user-menus' ), array( 'response' => 200, 'back_link' => true, ) );
|
175 |
}
|
190 |
* @return string
|
191 |
*/
|
192 |
public function template_path() {
|
193 |
+
return apply_filters( 'jpum_template_path', self::$TEMPLATE_PATH );
|
194 |
}
|
195 |
|
196 |
/**
|