Version Description
Download this release
Release Info
Developer | evertiro |
Plugin | Username Changer |
Version | 3.2.2 |
Comparing to | |
See all releases |
Code changes from version 3.2.1 to 3.2.2
- assets/banner-1544x500-rtl.png +0 -0
- assets/banner-1544x500.jpg +0 -0
- assets/banner-1544x500.png +0 -0
- assets/banner-772x250-rtl.png +0 -0
- assets/banner-772x250.jpg +0 -0
- assets/banner-772x250.png +0 -0
- assets/css/admin.css +16 -24
- assets/css/admin.min.css +1 -1
- assets/icon-128x128.jpg +0 -0
- assets/icon-128x128.png +0 -0
- assets/icon-256x256.jpg +0 -0
- assets/icon-256x256.png +0 -0
- assets/icon.svg +79 -0
- assets/js/admin.min.js +1 -1
- class-username-changer.php +2 -2
- includes/libraries/simple-settings/Gruntfile.js +0 -83
- includes/libraries/simple-settings/assets/css/admin.css +0 -43
- includes/libraries/simple-settings/assets/css/admin.min.css +0 -1
- includes/libraries/simple-settings/assets/js/admin.min.js +0 -1
- includes/libraries/simple-settings/composer.json +0 -26
- includes/libraries/simple-settings/package.json +0 -18
- includes/misc-functions.php +6 -0
- includes/scripts.php +1 -1
- languages/username-changer.pot +101 -2
- readme.txt +104 -94
- {includes/libraries → vendor/widgitlabs}/simple-settings/CHANGELOG.md +14 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/CONTRIBUTING.md +0 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/README.md +0 -0
- vendor/widgitlabs/simple-settings/assets/css/admin.css +71 -0
- vendor/widgitlabs/simple-settings/assets/css/admin.min.css +1 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/assets/css/jquery-ui-classic.min.css +0 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/assets/css/jquery-ui-fresh.min.css +0 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/assets/js/admin.js +3 -2
- vendor/widgitlabs/simple-settings/assets/js/admin.min.js +1 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/class-simple-settings.php +223 -154
- {includes/libraries → vendor/widgitlabs}/simple-settings/license.txt +0 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/modules/licensing/class-simple-settings-license.php +0 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/modules/licensing/class-simple-settings-plugin-updater.php +3 -3
- {includes/libraries → vendor/widgitlabs}/simple-settings/modules/sysinfo/class-browser.php +0 -0
- {includes/libraries → vendor/widgitlabs}/simple-settings/modules/sysinfo/class-simple-settings-sysinfo.php +0 -0
assets/banner-1544x500-rtl.png
DELETED
Binary file
|
assets/banner-1544x500.jpg
ADDED
Binary file
|
assets/banner-1544x500.png
DELETED
Binary file
|
assets/banner-772x250-rtl.png
DELETED
Binary file
|
assets/banner-772x250.jpg
ADDED
Binary file
|
assets/banner-772x250.png
DELETED
Binary file
|
assets/css/admin.css
CHANGED
@@ -5,43 +5,35 @@
|
|
5 |
* @since 3.0.0
|
6 |
*/
|
7 |
|
8 |
-
|
9 |
-
/* Support
|
10 |
-
-------------------------------------------------------------- */
|
11 |
-
.username-changer-get-help .dashicons {
|
12 |
-
vertical-align: middle;
|
13 |
-
line-height: 0.9em;
|
14 |
-
margin-right: 5px;
|
15 |
-
}
|
16 |
-
|
17 |
-
|
18 |
/* Support
|
19 |
-------------------------------------------------------------- */
|
20 |
.username-changer-settings-note {
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
}
|
25 |
|
26 |
.username-changer-settings-note .note-title {
|
27 |
-
|
28 |
}
|
29 |
|
30 |
.username-changer-template-tag-list {
|
31 |
-
|
32 |
}
|
33 |
|
34 |
.username-changer-template-tag span {
|
35 |
-
|
36 |
-
|
37 |
}
|
38 |
|
39 |
-
@media screen and (
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
-
.username-changer-template-tag span {
|
45 |
-
width: 100%;
|
46 |
-
}
|
47 |
}
|
5 |
* @since 3.0.0
|
6 |
*/
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
/* Support
|
9 |
-------------------------------------------------------------- */
|
10 |
.username-changer-settings-note {
|
11 |
+
background-color: #fcecad;
|
12 |
+
border: 1px solid #ccc;
|
13 |
+
padding: 7px;
|
14 |
}
|
15 |
|
16 |
.username-changer-settings-note .note-title {
|
17 |
+
font-weight: 700;
|
18 |
}
|
19 |
|
20 |
.username-changer-template-tag-list {
|
21 |
+
margin: 14px 14px 0 14px;
|
22 |
}
|
23 |
|
24 |
.username-changer-template-tag span {
|
25 |
+
width: 150px;
|
26 |
+
display: inline-block;
|
27 |
}
|
28 |
|
29 |
+
@media screen and (max-width: 480px) {
|
30 |
+
|
31 |
+
.username-changer-template-tag {
|
32 |
+
margin-bottom: 12px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.username-changer-template-tag span {
|
36 |
+
width: 100%;
|
37 |
+
}
|
38 |
|
|
|
|
|
|
|
39 |
}
|
assets/css/admin.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.username-changer-
|
1 |
+
.username-changer-settings-note{background-color:#fcecad;border:1px solid #ccc;padding:7px}.username-changer-settings-note .note-title{font-weight:700}.username-changer-template-tag-list{margin:14px 14px 0 14px}.username-changer-template-tag span{width:150px;display:inline-block}@media screen and (max-width:480px){.username-changer-template-tag{margin-bottom:12px}.username-changer-template-tag span{width:100%}}
|
assets/icon-128x128.jpg
ADDED
Binary file
|
assets/icon-128x128.png
DELETED
Binary file
|
assets/icon-256x256.jpg
ADDED
Binary file
|
assets/icon-256x256.png
DELETED
Binary file
|
assets/icon.svg
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
4 |
+
viewBox="0 0 256 256" style="enable-background:new 0 0 256 256;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{display:none;}
|
7 |
+
.st1{display:inline;opacity:0.27;}
|
8 |
+
.st2{fill:#FFFFFF;}
|
9 |
+
.st3{fill:#1793D1;}
|
10 |
+
.st4{opacity:0.27;}
|
11 |
+
.st5{fill:none;}
|
12 |
+
.st6{font-family:'Share-Bold';}
|
13 |
+
.st7{font-size:24px;}
|
14 |
+
</style>
|
15 |
+
<g id="Widgit_Source_1_" class="st0">
|
16 |
+
<g id="Widgit_2_" class="st1">
|
17 |
+
<g id="g3819_2_" transform="translate(197.3912,328.4617)">
|
18 |
+
</g>
|
19 |
+
<g id="g3823_2_" transform="translate(234.6236,343.6334)">
|
20 |
+
<path id="path3825_2_" class="st2" d="M14.7-139.8c-1.3,0.8-2.4,1.9-3.2,3.4c-2.6,4.5-1.1,10.3,3.5,13c4.5,2.6,10.3,1.1,13-3.5
|
21 |
+
c2.6-4.5,1-10.4-3.5-13C21.3-141.7,17.6-141.5,14.7-139.8L14.7-139.8z"/>
|
22 |
+
</g>
|
23 |
+
<g id="g3827_2_" transform="translate(232.8028,277.0195)">
|
24 |
+
<path id="path3829_2_" class="st2" d="M-7.6-33.9c-1.5,0.9-2.8,2.2-3.7,3.8c-3,5.2-1.2,11.9,4,14.9c5.2,3,11.9,1.2,14.9-4
|
25 |
+
c3-5.2,1.2-11.9-4-14.9C0-36.1-4.3-35.9-7.6-33.9"/>
|
26 |
+
</g>
|
27 |
+
<g id="g3831_2_" transform="translate(246.7023,361.8328)">
|
28 |
+
<path id="path3833_2_" class="st2" d="M16.2-164.7l21.4,37.1L16.2-90.6l-42.8,0L-48-127.6l21.4-37.1L16.2-164.7z M21.1-173.1
|
29 |
+
l-52.5,0l-26.2,45.5l26.3,45.5l52.5,0l26.2-45.5L21.1-173.1z"/>
|
30 |
+
</g>
|
31 |
+
<g id="g3835_2_" transform="translate(246.6597,300.3358)">
|
32 |
+
<path id="path3837_2_" class="st2" d="M-5.1-66.4c5.9,3.4,5.8-2.8,9.9,2.6c4.2,5.4-1.8,3.7,0,10.3c1.8,6.6,6.1,2.2,5.2,8.9
|
33 |
+
c-0.9,6.7-3.9,1.4-7.3,7.3c-1.5,2.6-1.1,4.1-0.7,5.2l12.5,0l19.7-34.1l-7.5-13.1c-0.1,0.4-0.3,0.8-0.7,1.4
|
34 |
+
c-2.8,4.8-3.4-0.2-7.8,3.2c-4.4,3.4,0.3,5.2-5.1,6.7c-5.4,1.4-2.3-2.5-7.7-3.2c-5.5-0.7-3.5,3.9-8.3,1.1L-5.1-66.4z M-24.9-100.3
|
35 |
+
l-19.7,34.1l6.3,10.9c1.2-0.2,2.6-0.6,4.1-3.2c3.4-5.9-2.8-5.8,2.6-10c0.3-0.3,0.6-0.5,0.9-0.7c4.3-2.8,3.2,2.4,9.4,0.7
|
36 |
+
c6.6-1.8,2.2-6.1,8.9-5.2c6.7,0.9,1.4,3.9,7.3,7.3l2.1-3.7c-4.8-2.8,0.2-3.4-3.2-7.8c-3.4-4.4-5.2,0.3-6.7-5.1s2.5-2.3,3.2-7.7
|
37 |
+
c0.7-5.5-3.9-3.5-1.1-8.3c0.3-0.5,0.6-0.9,0.9-1.3L-24.9-100.3L-24.9-100.3z"/>
|
38 |
+
</g>
|
39 |
+
</g>
|
40 |
+
</g>
|
41 |
+
<g id="Frame">
|
42 |
+
<g id="Background_8_">
|
43 |
+
<rect y="0" class="st3" width="256" height="256"/>
|
44 |
+
</g>
|
45 |
+
</g>
|
46 |
+
<g id="Matte">
|
47 |
+
<g id="Background_1_">
|
48 |
+
<rect x="4" y="4" class="st2" width="248" height="248"/>
|
49 |
+
</g>
|
50 |
+
</g>
|
51 |
+
<g id="Canvas">
|
52 |
+
<g id="Background_2_">
|
53 |
+
<rect x="8" y="8" class="st3" width="240" height="240"/>
|
54 |
+
</g>
|
55 |
+
</g>
|
56 |
+
<g id="Widgit">
|
57 |
+
<g class="st4">
|
58 |
+
<path class="st2" d="M248,204.9c-0.7,0.7-1.4,1.4-1.9,2.3c-2.3,4-1.4,8.9,1.9,11.8V204.9z"/>
|
59 |
+
<path class="st2" d="M236.4,243c-3.6-2.1-7.9-1.9-11.2,0.2c-1.5,0.9-2.8,2.2-3.7,3.8c-0.2,0.3-0.4,0.7-0.5,1h19.9
|
60 |
+
C240,246,238.5,244.2,236.4,243z"/>
|
61 |
+
<polygon class="st2" points="198.7,234.2 220.1,197.1 248,197.1 248,188.7 215.2,188.7 189,234.2 197,248 206.7,248 "/>
|
62 |
+
<path class="st2" d="M215.1,231.9c0.3-0.3,0.6-0.5,0.9-0.7c4.3-2.8,3.2,2.4,9.4,0.7c6.6-1.8,2.2-6.1,8.9-5.2
|
63 |
+
c6.7,0.9,1.4,3.9,7.3,7.3l0,0c3.6,2.1,4.9,0.6,6.4,0.3v-4.2c-1,0.9-1.5,1.7-4.3,0.1l0,0c-4.8-2.8,0.2-3.4-3.2-7.8
|
64 |
+
c-3.4-4.4-5.2,0.3-6.7-5.1s2.5-2.3,3.2-7.7c0.7-5.5-3.9-3.5-1.1-8.3c0.3-0.5,0.6-0.9,0.9-1.3l-15.1,0l0,0l-19.7,34.1l6.3,10.9
|
65 |
+
c1.2-0.2,2.6-0.6,4.1-3.2C215.9,235.9,209.7,236,215.1,231.9z"/>
|
66 |
+
</g>
|
67 |
+
</g>
|
68 |
+
<g id="Label">
|
69 |
+
<rect x="12" y="200" class="st5" width="232" height="43.8"/>
|
70 |
+
<text transform="matrix(1 0 0 1 12 217.5078)"><tspan x="0" y="0" class="st2 st6 st7">username</tspan><tspan x="0" y="21" class="st2 st6 st7">changer</tspan></text>
|
71 |
+
</g>
|
72 |
+
<g id="Icon">
|
73 |
+
<path class="st2" d="M104,128c17.7,0,32-14.3,32-32s-14.3-32-32-32S72,78.3,72,96S86.3,128,104,128z M126.4,136h-4.2
|
74 |
+
c-5.6,2.6-11.7,4-18.2,4s-12.7-1.4-18.2-4h-4.2C63.1,136,48,151,48,169.6V180c0,6.6,5.4,12,12,12h68.7c-0.6-1.7-0.8-3.5-0.6-5.3
|
75 |
+
l1.7-15.2l0.3-2.8l2-2l19.3-19.3C145.3,140.4,136.4,136,126.4,136z M137.7,172.3l-1.7,15.3c-0.3,2.6,1.9,4.7,4.4,4.4l15.2-1.7
|
76 |
+
l34.5-34.5l-17.9-17.9L137.7,172.3z M206.3,131.2l-9.5-9.5c-2.3-2.3-6.1-2.3-8.4,0l-9.4,9.4l-1,1l17.9,17.9l10.4-10.4
|
77 |
+
C208.6,137.3,208.6,133.6,206.3,131.2z"/>
|
78 |
+
</g>
|
79 |
+
</svg>
|
assets/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(document.body).ready(function($){"use strict";var profileForm,mount,message,link,currentUsernameInput,newUsernameInput,submitButton,cancelButton,minimumLength;({init:function(){this.general()},general:function(){}}).init(),{init:function(){this.general()},general:function(){"profile"!==username_changer_vars.current_screen&&"user-edit"!==username_changer_vars.current_screen||"1"!==username_changer_vars.can_change_username||(currentUsernameInput=document.getElementById("user_login"),mount=document.querySelector(".user-user-login-wrap td .description"),link=this.createElement("a",{id:"username-changer-link",href:"#",onclick:this.toggle},username_changer_vars.change_button_label),newUsernameInput=this.createElement("input",{id:"username-changer-input",type:"text",name:"new_user_login",value:currentUsernameInput.value,className:"regular-text",style:{"min-height":"28px"},autocomplete:"off"}),cancelButton=this.createElement("input",{id:"username-changer-cancel",type:"button",value:username_changer_vars.cancel_button_label,className:"button",style:{"margin-left":"5px"},onclick:this.toggle}),submitButton=this.createElement("input",{id:"username-changer-submit",type:"button",value:username_changer_vars.save_button_label,className:"button",style:{"margin-left":"5px"},onclick:this.onSubmit}),profileForm=this.createElement("form",{id:"username-changer-form",method:"POST",onsubmit:this.onSubmit,style:{display:"none"}},[newUsernameInput,submitButton,cancelButton]),message=this.createElement("p",{id:"username-changer-message",style:{display:"none"}}),mount.parentNode.replaceChild(link,mount),link.parentNode.appendChild(this.createElement("div",[profileForm,message])),minimumLength=parseInt(username_changer_vars.minimum_length),$("#username-changer-input").on("input",function(){$(this).val().length<minimumLength?(message.style.color="red",message.textContent=username_changer_vars.error_short_username,message.style.display="",submitButton.disabled=!0):!0===submitButton.disabled&&(message.style.display="none",message.textContent="",submitButton.disabled=!1,cancelButton.disabled=!1)}))},createElement:function(name,attrs,children){var e=document.createElement(name);if(children||!Array.isArray(attrs)&&"string"!=typeof attrs||(children=attrs,attrs=null),attrs&&this.setAttribute(e,attrs),children)if("string"==typeof children)e.textContent=children;else for(var i=0;i<children.length;i++)e.appendChild(children[i]);return e},setAttribute:function(object,attrs){for(var key in attrs)"object"==typeof attrs[key]?this.setAttribute(object[key],attrs[key]):object[key]=attrs[key]},toggle:function(e){e.preventDefault(),"none"===profileForm.style.display?(profileForm.style.display="",link.style.display="none",currentUsernameInput.style.display="none",newUsernameInput.focus()):(profileForm.style.display="none",link.style.display="inline",currentUsernameInput.style.display="",message.style.display="none",message.textContent="",newUsernameInput.value=currentUsernameInput.value,submitButton.disabled=!1,cancelButton.disabled=!1)},onSubmit:function(e){e.preventDefault();var
|
1 |
+
jQuery(document.body).ready(function($){"use strict";var profileForm,mount,message,link,currentUsernameInput,newUsernameInput,submitButton,cancelButton,minimumLength;({init:function(){this.general()},general:function(){}}).init(),{init:function(){this.general()},general:function(){"profile"!==username_changer_vars.current_screen&&"user-edit"!==username_changer_vars.current_screen||"1"!==username_changer_vars.can_change_username||(currentUsernameInput=document.getElementById("user_login"),mount=document.querySelector(".user-user-login-wrap td .description"),link=this.createElement("a",{id:"username-changer-link",href:"#",onclick:this.toggle},username_changer_vars.change_button_label),newUsernameInput=this.createElement("input",{id:"username-changer-input",type:"text",name:"new_user_login",value:currentUsernameInput.value,className:"regular-text",style:{"min-height":"28px"},autocomplete:"off"}),cancelButton=this.createElement("input",{id:"username-changer-cancel",type:"button",value:username_changer_vars.cancel_button_label,className:"button",style:{"margin-left":"5px"},onclick:this.toggle}),submitButton=this.createElement("input",{id:"username-changer-submit",type:"button",value:username_changer_vars.save_button_label,className:"button",style:{"margin-left":"5px"},onclick:this.onSubmit}),profileForm=this.createElement("form",{id:"username-changer-form",method:"POST",onsubmit:this.onSubmit,style:{display:"none"}},[newUsernameInput,submitButton,cancelButton]),message=this.createElement("p",{id:"username-changer-message",style:{display:"none"}}),mount.parentNode.replaceChild(link,mount),link.parentNode.appendChild(this.createElement("div",[profileForm,message])),minimumLength=parseInt(username_changer_vars.minimum_length),$("#username-changer-input").on("input",function(){$(this).val().length<minimumLength?(message.style.color="red",message.textContent=username_changer_vars.error_short_username,message.style.display="",submitButton.disabled=!0):!0===submitButton.disabled&&(message.style.display="none",message.textContent="",submitButton.disabled=!1,cancelButton.disabled=!1)}))},createElement:function(name,attrs,children){var e=document.createElement(name);if(children||!Array.isArray(attrs)&&"string"!=typeof attrs||(children=attrs,attrs=null),attrs&&this.setAttribute(e,attrs),children)if("string"==typeof children)e.textContent=children;else for(var i=0;i<children.length;i++)e.appendChild(children[i]);return e},setAttribute:function(object,attrs){for(var key in attrs)"object"==typeof attrs[key]?this.setAttribute(object[key],attrs[key]):object[key]=attrs[key]},toggle:function(e){e.preventDefault(),"none"===profileForm.style.display?(profileForm.style.display="",link.style.display="none",currentUsernameInput.style.display="none",newUsernameInput.focus()):(profileForm.style.display="none",link.style.display="inline",currentUsernameInput.style.display="",message.style.display="none",message.textContent="",newUsernameInput.value=currentUsernameInput.value,submitButton.disabled=!1,cancelButton.disabled=!1)},onSubmit:function(e){e.preventDefault();var postData,error=!0,newUsername=profileForm.new_user_login.value,currentUsername=currentUsernameInput.value;if(minimumLength=parseInt(username_changer_vars.minimum_length),newUsername!==currentUsername){if(submitButton.value=username_changer_vars.please_wait_message,submitButton.disabled=!0,cancelButton.disabled=!0,newUsername.length<minimumLength)return message.style.color="red",message.textContent=username_changer_vars.error_short_username,message.style.display="",submitButton.value=username_changer_vars.save_button_label,void(cancelButton.disabled=!1);postData={action:"change_username",old_username:currentUsername,new_username:newUsername,security:username_changer_vars.nonce},$.ajax({type:"POST",data:postData,dataType:"json",url:username_changer_vars.ajaxurl,success:function(response){if(null!==response)try{username_changer_vars.nonce=response.new_nonce,message.style.color=response.success?"green":"red",message.innerHTML=response.message,response.success&&(currentUsernameInput.value=newUsername,error=!1)}catch(e){message.style.color="red",message.textContent=username_changer_vars.error_unknown}else message.style.color="red",message.textContent=username_changer_vars.error_unknown;if(message.style.display="",cancelButton.disabled=!1,submitButton.value=username_changer_vars.save_button_label,!1===error)return currentUsernameInput.value=newUsername,$('input[name="nickname"]').val()===currentUsername&&$('input[name="nickname"]').val(newUsername),$('select[name="display_name"] option:selected').text()===currentUsername&&$('select[name="display_name"] option:selected').text(newUsername),profileForm.style.display="none",link.style.display="inline",void(currentUsernameInput.style.display="")}}).fail(function(data){window.console&&window.console.log&&console.log(data)})}else cancelButton.click()}}.init()});
|
class-username-changer.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Change usernames easily
|
6 |
* Author: Widgit Team
|
7 |
* Author URI: https://widgit.io
|
8 |
-
* Version: 3.2.
|
9 |
* Text Domain: username-changer
|
10 |
* Domain Path: languages
|
11 |
*
|
@@ -163,7 +163,7 @@ if ( ! class_exists( 'Username_Changer' ) ) {
|
|
163 |
|
164 |
// Load settings handler if necessary.
|
165 |
if ( ! class_exists( 'Simple_Settings' ) ) {
|
166 |
-
require_once USERNAME_CHANGER_DIR . '
|
167 |
}
|
168 |
|
169 |
require_once USERNAME_CHANGER_DIR . 'includes/admin/settings/register-settings.php';
|
5 |
* Description: Change usernames easily
|
6 |
* Author: Widgit Team
|
7 |
* Author URI: https://widgit.io
|
8 |
+
* Version: 3.2.2
|
9 |
* Text Domain: username-changer
|
10 |
* Domain Path: languages
|
11 |
*
|
163 |
|
164 |
// Load settings handler if necessary.
|
165 |
if ( ! class_exists( 'Simple_Settings' ) ) {
|
166 |
+
require_once USERNAME_CHANGER_DIR . 'vendor/widgitlabs/simple-settings/class-simple-settings.php';
|
167 |
}
|
168 |
|
169 |
require_once USERNAME_CHANGER_DIR . 'includes/admin/settings/register-settings.php';
|
includes/libraries/simple-settings/Gruntfile.js
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
module.exports = function(grunt) {
|
2 |
-
|
3 |
-
// Load multiple grunt tasks using globbing patterns
|
4 |
-
require('load-grunt-tasks')(grunt);
|
5 |
-
|
6 |
-
// Project configuration.
|
7 |
-
grunt.initConfig({
|
8 |
-
|
9 |
-
pkg: grunt.file.readJSON('package.json'),
|
10 |
-
|
11 |
-
cssmin: {
|
12 |
-
options: {
|
13 |
-
mergeIntoShorthands: false,
|
14 |
-
},
|
15 |
-
target: {
|
16 |
-
files: [
|
17 |
-
{
|
18 |
-
expand: true,
|
19 |
-
cwd: 'assets/css',
|
20 |
-
src: ['admin.css'],
|
21 |
-
dest: 'assets/css',
|
22 |
-
ext: '.min.css'
|
23 |
-
}
|
24 |
-
],
|
25 |
-
}
|
26 |
-
},
|
27 |
-
|
28 |
-
uglify: {
|
29 |
-
options: {
|
30 |
-
mangle: false,
|
31 |
-
},
|
32 |
-
target: {
|
33 |
-
files: [{
|
34 |
-
expand: true,
|
35 |
-
cwd: 'assets/js',
|
36 |
-
src: [ '*.js', '!*.min.js', '!*jquery*.js' ],
|
37 |
-
dest: 'assets/js',
|
38 |
-
ext: '.min.js',
|
39 |
-
extDot: 'last',
|
40 |
-
}]
|
41 |
-
}
|
42 |
-
},
|
43 |
-
|
44 |
-
// Clean up build directory
|
45 |
-
clean: {
|
46 |
-
main: ['build/<%= pkg.name %>']
|
47 |
-
},
|
48 |
-
|
49 |
-
// Copy the plugin into the build directory
|
50 |
-
copy: {
|
51 |
-
main: {
|
52 |
-
src: [
|
53 |
-
'assets/**',
|
54 |
-
'includes/**',
|
55 |
-
'languages/**',
|
56 |
-
'templates/**',
|
57 |
-
'*.php',
|
58 |
-
'*.txt'
|
59 |
-
],
|
60 |
-
dest: 'build/<%= pkg.name %>/'
|
61 |
-
}
|
62 |
-
},
|
63 |
-
|
64 |
-
// Compress build directory into <name>.zip and <name>-<version>.zip
|
65 |
-
compress: {
|
66 |
-
main: {
|
67 |
-
options: {
|
68 |
-
mode: 'zip',
|
69 |
-
archive: './build/<%= pkg.name %>.zip'
|
70 |
-
},
|
71 |
-
expand: true,
|
72 |
-
cwd: 'build/<%= pkg.name %>/',
|
73 |
-
src: ['**/*'],
|
74 |
-
dest: '<%= pkg.name %>/'
|
75 |
-
}
|
76 |
-
},
|
77 |
-
|
78 |
-
});
|
79 |
-
|
80 |
-
// Build task(s).
|
81 |
-
grunt.registerTask( 'build', [ 'cssmin', 'uglify', 'clean', 'copy', 'compress' ] );
|
82 |
-
|
83 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/simple-settings/assets/css/admin.css
DELETED
@@ -1,43 +0,0 @@
|
|
1 |
-
.simple-settings-options-table .form-table label {
|
2 |
-
color: #666;
|
3 |
-
font-size: 14px;
|
4 |
-
font-style: italic;
|
5 |
-
margin: 4px 0 0;
|
6 |
-
}
|
7 |
-
|
8 |
-
/* Fix color picker label alignment
|
9 |
-
-------------------------------------------------------------- */
|
10 |
-
.simple-settings-color-picker-label {
|
11 |
-
position: absolute;
|
12 |
-
display: inline-block;
|
13 |
-
padding-top: 4px;
|
14 |
-
}
|
15 |
-
|
16 |
-
/* System info styles
|
17 |
-
-------------------------------------------------------------- */
|
18 |
-
#system-info-textarea {
|
19 |
-
width: 800px;
|
20 |
-
height: 400px;
|
21 |
-
font-family: Menlo, Monaco, monospace;
|
22 |
-
background: none;
|
23 |
-
white-space: pre;
|
24 |
-
overflow: auto;
|
25 |
-
display: block;
|
26 |
-
}
|
27 |
-
|
28 |
-
/* Tooltips
|
29 |
-
-------------------------------------------------------------- */
|
30 |
-
.simple-settings-help-tip {
|
31 |
-
cursor: help;
|
32 |
-
vertical-align: middle;
|
33 |
-
}
|
34 |
-
|
35 |
-
.ui-tooltip {
|
36 |
-
background: #333 !important;
|
37 |
-
border-radius: 3px !important;
|
38 |
-
box-shadow: 1px 1px 2px 1px rgba(214,214,214,0.5);
|
39 |
-
color: #dedede !important;
|
40 |
-
max-width: 300px;
|
41 |
-
padding: 7px;
|
42 |
-
text-rendering: optimizeLegibility;
|
43 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/simple-settings/assets/css/admin.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.simple-settings-options-table .form-table label{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}.simple-settings-color-picker-label{position:absolute;display:inline-block;padding-top:4px}#system-info-textarea{width:800px;height:400px;font-family:Menlo,Monaco,monospace;background:0 0;white-space:pre;overflow:auto;display:block}.simple-settings-help-tip{cursor:help;vertical-align:middle}.ui-tooltip{background:#333!important;border-radius:3px!important;box-shadow:1px 1px 2px 1px rgba(214,214,214,.5);color:#dedede!important;max-width:300px;padding:7px;text-rendering:optimizeLegibility}
|
|
includes/libraries/simple-settings/assets/js/admin.min.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function($){"use strict";var file_frame;($(".simple-settings-color-picker").length&&$(".simple-settings-color-picker").wpColorPicker(),$(".simple-settings-select2").length&&$(".simple-settings-select2").select2(),$(".simple-settings-html").length&&$(".simple-settings-html").each(function(index,elem){CodeMirror.fromTextArea(elem,{lineNumbers:!0,mode:"text/html",showCursorWhenSelecting:!0})}),$(".simple-settings-help-tip").tooltip({content:function(){return $(this).prop("title")},position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}}),$("."+simple_settings_vars.func+"_settings_upload_button").length)&&($("body").on("click","."+simple_settings_vars.func+"_settings_upload_button",function(e){e.preventDefault();var button=$(this);window.formfield=$(this).parent().prev(),file_frame||(wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader_title"),button:{text:button.data("uploader_button_text")},multiple:!1}),(file_frame=wp.media.frames.file_frame).on("menu:render:default",function(view){view.unset("library-separator"),view.unset("gallery"),view.unset("featured-image"),view.unset("embed"),view.set({})}),file_frame.on("insert",function(){file_frame.state().get("selection").each(function(attachment){attachment=attachment.toJSON(),window.formfield.val(attachment.url)})})),file_frame.open()}),window.formfield="")});
|
|
includes/libraries/simple-settings/composer.json
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "widgitlabs/simple-settings",
|
3 |
-
"type": "library",
|
4 |
-
"description": "A library for implementing a simple, transparent settings panel in WordPress.",
|
5 |
-
"keywords": ["settings", "options", "WordPress"],
|
6 |
-
"homepage": "https://widgit.io/",
|
7 |
-
"license": "GPL-3.0+",
|
8 |
-
"authors": [
|
9 |
-
{
|
10 |
-
"name": "Daniel J Griffiths",
|
11 |
-
"email": "dgriffiths@evertiro.com"
|
12 |
-
}
|
13 |
-
],
|
14 |
-
"support": {
|
15 |
-
"issues": "https://gitlab.com/widgitlabs/wordpress/simple-settings/issues"
|
16 |
-
},
|
17 |
-
"require": {
|
18 |
-
"php": ">=5.3.0",
|
19 |
-
"composer/installers": "~1.0"
|
20 |
-
},
|
21 |
-
"require-dev": {
|
22 |
-
"phpunit/phpunit": "4.8.* || 5.7.*",
|
23 |
-
"phpunit/php-invoker": "1.1.3"
|
24 |
-
},
|
25 |
-
"minimum-stability": "dev"
|
26 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/libraries/simple-settings/package.json
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"name": "simple-settings",
|
3 |
-
"version": "1.2.1",
|
4 |
-
"private": true,
|
5 |
-
"devDependencies": {
|
6 |
-
"grunt": "^1.0.4",
|
7 |
-
"grunt-contrib-clean": "^1.1.0",
|
8 |
-
"grunt-contrib-compress": "^1.5.0",
|
9 |
-
"grunt-contrib-copy": "^1.0.0",
|
10 |
-
"grunt-contrib-cssmin": "^2.2.1",
|
11 |
-
"grunt-contrib-uglify": "^3.3.0",
|
12 |
-
"load-grunt-tasks": "^3.5.2"
|
13 |
-
},
|
14 |
-
"dependencies": {
|
15 |
-
"grunt-cli": "^1.3.2",
|
16 |
-
"npm": "^6.9.0"
|
17 |
-
}
|
18 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/misc-functions.php
CHANGED
@@ -75,6 +75,9 @@ function username_changer_process( $old_username, $new_username ) {
|
|
75 |
// One last sanity check to ensure the user exists.
|
76 |
$user_id = username_exists( $old_username );
|
77 |
if ( $user_id ) {
|
|
|
|
|
|
|
78 |
// Update username!
|
79 |
$q = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $old_username ); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables
|
80 |
|
@@ -129,6 +132,9 @@ function username_changer_process( $old_username, $new_username ) {
|
|
129 |
$return = true;
|
130 |
}
|
131 |
|
|
|
|
|
|
|
132 |
return $return;
|
133 |
}
|
134 |
}
|
75 |
// One last sanity check to ensure the user exists.
|
76 |
$user_id = username_exists( $old_username );
|
77 |
if ( $user_id ) {
|
78 |
+
// Let devs hook into the process.
|
79 |
+
do_action( 'username_changer_before_process', $old_username, $new_username );
|
80 |
+
|
81 |
// Update username!
|
82 |
$q = $wpdb->prepare( "UPDATE $wpdb->users SET user_login = %s WHERE user_login = %s", $new_username, $old_username ); // phpcs:ignore WordPressVIPMinimum.Variables.RestrictedVariables
|
83 |
|
132 |
$return = true;
|
133 |
}
|
134 |
|
135 |
+
// Let devs hook into the process.
|
136 |
+
do_action( 'username_changer_after_process', $old_username, $new_username );
|
137 |
+
|
138 |
return $return;
|
139 |
}
|
140 |
}
|
includes/scripts.php
CHANGED
@@ -28,7 +28,7 @@ function username_changer_admin_scripts() {
|
|
28 |
$minimum_length = username_changer()->settings->get_option( 'minimum_length', 3 );
|
29 |
$screen = get_current_screen();
|
30 |
|
31 |
-
wp_enqueue_script( 'username-changer', $js_dir . 'admin.js', array( 'jquery' ), USERNAME_CHANGER_VER );
|
32 |
wp_localize_script(
|
33 |
'username-changer',
|
34 |
'username_changer_vars',
|
28 |
$minimum_length = username_changer()->settings->get_option( 'minimum_length', 3 );
|
29 |
$screen = get_current_screen();
|
30 |
|
31 |
+
wp_enqueue_script( 'username-changer', $js_dir . 'admin.js', array( 'jquery' ), USERNAME_CHANGER_VER, true );
|
32 |
wp_localize_script(
|
33 |
'username-changer',
|
34 |
'username_changer_vars',
|
languages/username-changer.pot
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
# This file is distributed under the same license as the Username Changer package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Username Changer 3.2.
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://gitlab.com/widgitlabs/wordpress/Username-Changer/issues\n"
|
8 |
-
"POT-Creation-Date: 2020-
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -344,6 +344,105 @@ msgstr ""
|
|
344 |
msgid "HTTP requests disabled for unit tests"
|
345 |
msgstr ""
|
346 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
347 |
#. Description of the plugin/theme
|
348 |
msgid "Change usernames easily"
|
349 |
msgstr ""
|
2 |
# This file is distributed under the same license as the Username Changer package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Username Changer 3.2.2\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://gitlab.com/widgitlabs/wordpress/Username-Changer/issues\n"
|
8 |
+
"POT-Creation-Date: 2020-05-25 19:18:12+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
344 |
msgid "HTTP requests disabled for unit tests"
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:167
|
348 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:169
|
349 |
+
msgid "Simple Settings"
|
350 |
+
msgstr ""
|
351 |
+
|
352 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:661
|
353 |
+
msgid "Settings updated."
|
354 |
+
msgstr ""
|
355 |
+
|
356 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1199
|
357 |
+
msgid ""
|
358 |
+
"To copy the system info, click below then press Ctrl + C (PC) or Cmd + C "
|
359 |
+
"(Mac)."
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1202
|
363 |
+
msgid "Download System Info File"
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1300
|
367 |
+
msgid "Upload File"
|
368 |
+
msgstr ""
|
369 |
+
|
370 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1335
|
371 |
+
msgid "Deactivate License"
|
372 |
+
msgstr ""
|
373 |
+
|
374 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1370
|
375 |
+
#. Translators: The passed ID that has no corresponding callback.
|
376 |
+
msgid "The callback function used for the <strong>%s</strong> setting is missing."
|
377 |
+
msgstr ""
|
378 |
+
|
379 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1465
|
380 |
+
msgid "Insert Image"
|
381 |
+
msgstr ""
|
382 |
+
|
383 |
+
#: vendor/widgitlabs/simple-settings/class-simple-settings.php:1466
|
384 |
+
msgid "Select Image"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:228
|
388 |
+
msgid "Licensing"
|
389 |
+
msgstr ""
|
390 |
+
|
391 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:247
|
392 |
+
#. Translators: The item name for this license.
|
393 |
+
msgid "%1$s License Key"
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:248
|
397 |
+
msgid "Please enter your license key to enable automatic updates and support."
|
398 |
+
msgstr ""
|
399 |
+
|
400 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:291
|
401 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:369
|
402 |
+
msgid "Nonce verification failed"
|
403 |
+
msgstr ""
|
404 |
+
|
405 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:291
|
406 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:369
|
407 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-plugin-updater.php:412
|
408 |
+
msgid "Error"
|
409 |
+
msgstr ""
|
410 |
+
|
411 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:450
|
412 |
+
msgid "This license does not belong to the product you have entered it for."
|
413 |
+
msgstr ""
|
414 |
+
|
415 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:453
|
416 |
+
msgid "This license does not have any activations left"
|
417 |
+
msgstr ""
|
418 |
+
|
419 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:456
|
420 |
+
msgid "This license key is expired. Please renew it."
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-license.php:460
|
424 |
+
#. Translators: The details of the error code.
|
425 |
+
msgid ""
|
426 |
+
"There was a problem activating your license key, please try again or "
|
427 |
+
"contact support. Error code: %s"
|
428 |
+
msgstr ""
|
429 |
+
|
430 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-plugin-updater.php:246
|
431 |
+
#. Translators: The name, link, and version.
|
432 |
+
msgid "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-plugin-updater.php:255
|
436 |
+
#. Translators: The name, link, version, and download link.
|
437 |
+
msgid ""
|
438 |
+
"There is a new version of %1$s available. %2$sView version %3$s details%4$s "
|
439 |
+
"or %5$supdate now%6$s."
|
440 |
+
msgstr ""
|
441 |
+
|
442 |
+
#: vendor/widgitlabs/simple-settings/modules/licensing/class-simple-settings-plugin-updater.php:412
|
443 |
+
msgid "You do not have permission to install plugin updates"
|
444 |
+
msgstr ""
|
445 |
+
|
446 |
#. Description of the plugin/theme
|
447 |
msgid "Change usernames easily"
|
448 |
msgstr ""
|
readme.txt
CHANGED
@@ -1,94 +1,104 @@
|
|
1 |
-
=== Username Changer ===
|
2 |
-
Contributors: widgitlabs, evertiro
|
3 |
-
Donate link: https://evertiro.com/donate/
|
4 |
-
Tags: user, username, display name, login
|
5 |
-
Requires at least: 3.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 3.2.
|
8 |
-
|
9 |
-
Change usernames easily
|
10 |
-
|
11 |
-
== Description ==
|
12 |
-
|
13 |
-
Changing usernames should be a pretty straightforward feature. Unfortunately, WordPress doesn't allow it by default. Username Changer attempts to remedy that oversight.
|
14 |
-
|
15 |
-
== Installation ==
|
16 |
-
|
17 |
-
= From your WordPress dashboard =
|
18 |
-
|
19 |
-
1. Visit 'Plugins > Add New'
|
20 |
-
2. Search for 'Username Changer'
|
21 |
-
3. Activate Username Changer from your Plugins page
|
22 |
-
|
23 |
-
= From WordPress.org =
|
24 |
-
|
25 |
-
1. Download Username Changer
|
26 |
-
2. Upload the 'username-changer' folder to the '/wp-content/plugins' directory of your WordPress installation
|
27 |
-
3. Activate Username Changer from your Plugins page
|
28 |
-
|
29 |
-
== Frequently Asked Questions ==
|
30 |
-
|
31 |
-
= Is Username Changer compatible with <a href="https://wordpress.org/plugins/co-authors-plus/">Co-Authors Plus</a>? =
|
32 |
-
|
33 |
-
Yes! Username Changer works out of the box with Co-Authors Plus.
|
34 |
-
|
35 |
-
== Screenshots ==
|
36 |
-
|
37 |
-
1.
|
38 |
-
2.
|
39 |
-
|
40 |
-
== Changelog ==
|
41 |
-
|
42 |
-
= Version 3.
|
43 |
-
*
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
*
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
* Added:
|
57 |
-
|
58 |
-
|
59 |
-
*
|
60 |
-
|
61 |
-
= Version
|
62 |
-
* Fixed:
|
63 |
-
|
64 |
-
= Version
|
65 |
-
*
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
*
|
76 |
-
|
77 |
-
= Version 2.0.
|
78 |
-
*
|
79 |
-
|
80 |
-
= Version
|
81 |
-
* Added:
|
82 |
-
|
83 |
-
= Version 1
|
84 |
-
*
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
*
|
92 |
-
|
93 |
-
= Version 1.
|
94 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Username Changer ===
|
2 |
+
Contributors: widgitlabs, evertiro
|
3 |
+
Donate link: https://evertiro.com/donate/
|
4 |
+
Tags: user, username, display name, login
|
5 |
+
Requires at least: 3.0
|
6 |
+
Tested up to: 5.4.1
|
7 |
+
Stable tag: 3.2.2
|
8 |
+
|
9 |
+
Change usernames easily
|
10 |
+
|
11 |
+
== Description ==
|
12 |
+
|
13 |
+
Changing usernames should be a pretty straightforward feature. Unfortunately, WordPress doesn't allow it by default. Username Changer attempts to remedy that oversight.
|
14 |
+
|
15 |
+
== Installation ==
|
16 |
+
|
17 |
+
= From your WordPress dashboard =
|
18 |
+
|
19 |
+
1. Visit 'Plugins > Add New'
|
20 |
+
2. Search for 'Username Changer'
|
21 |
+
3. Activate Username Changer from your Plugins page
|
22 |
+
|
23 |
+
= From WordPress.org =
|
24 |
+
|
25 |
+
1. Download Username Changer
|
26 |
+
2. Upload the 'username-changer' folder to the '/wp-content/plugins' directory of your WordPress installation
|
27 |
+
3. Activate Username Changer from your Plugins page
|
28 |
+
|
29 |
+
== Frequently Asked Questions ==
|
30 |
+
|
31 |
+
= Is Username Changer compatible with <a href="https://wordpress.org/plugins/co-authors-plus/">Co-Authors Plus</a>? =
|
32 |
+
|
33 |
+
Yes! Username Changer works out of the box with Co-Authors Plus.
|
34 |
+
|
35 |
+
== Screenshots ==
|
36 |
+
|
37 |
+
1. Settings Panel: The settings panel allows you to configure username rules and message strings.
|
38 |
+
2. Changing A Username" Since version 3.0.0, usernames are now changed through the user profile page.
|
39 |
+
|
40 |
+
== Changelog ==
|
41 |
+
|
42 |
+
= Version 3.2.2 =
|
43 |
+
* Updated: General cleanup
|
44 |
+
* Updated: Settings library
|
45 |
+
|
46 |
+
= Version 3.2.1 =
|
47 |
+
* Updated: Settings library (fixes sysinfo security vulnerability)
|
48 |
+
|
49 |
+
= Version 3.2.0 =
|
50 |
+
* Updated: Bring code up to reasonable standards
|
51 |
+
|
52 |
+
= Version 3.1.1 =
|
53 |
+
* Fixed: Issue with multicheck settings fields
|
54 |
+
|
55 |
+
+ Version 3.1.0 =
|
56 |
+
* Added: Email notification support
|
57 |
+
* Added: Nickname support
|
58 |
+
* Improved: SQL performance
|
59 |
+
* Improved: Dynamically update profile files
|
60 |
+
|
61 |
+
= Version 3.0.1 =
|
62 |
+
* Fixed: Typo in readme file
|
63 |
+
|
64 |
+
= Version 3.0.0 =
|
65 |
+
* Improved: Replaced the clunky interface with an inline profile field (props: Danny van Kooten)
|
66 |
+
* Added: Settings panel
|
67 |
+
|
68 |
+
= Version 2.1.1 =
|
69 |
+
* Removed: Deprecated functions
|
70 |
+
|
71 |
+
= Version 2.0.5 =
|
72 |
+
* Fixed: Contributor field
|
73 |
+
|
74 |
+
= Version 2.0.4 =
|
75 |
+
* Updated: Plugin metalinks
|
76 |
+
|
77 |
+
= Version 2.0.3 =
|
78 |
+
* Fixed: User nice name support
|
79 |
+
|
80 |
+
= Version 2.0.2 =
|
81 |
+
* Added: multisite support
|
82 |
+
|
83 |
+
= Version 2.0.1 =
|
84 |
+
* Added: Proper username sanitization
|
85 |
+
* Improved: Minor code cleanup
|
86 |
+
|
87 |
+
= Version 2.0.0 =
|
88 |
+
* Improved: Converted to class-based structure
|
89 |
+
|
90 |
+
= Version 1.4 =
|
91 |
+
* Added: Include author url (nicename) in update process
|
92 |
+
|
93 |
+
= Version 1.3 =
|
94 |
+
* Fixed: Properly escaped vars on POST (I think)
|
95 |
+
|
96 |
+
= Version 1.2 =
|
97 |
+
* Fixed: Minor tweak to previous release
|
98 |
+
|
99 |
+
= Version 1.1 =
|
100 |
+
* Added: Action on All Users page
|
101 |
+
* Improved: User dropdown is now sorted alphabetically
|
102 |
+
|
103 |
+
= Version 1.0 =
|
104 |
+
* Initial release
|
{includes/libraries → vendor/widgitlabs}/simple-settings/CHANGELOG.md
RENAMED
@@ -1,5 +1,19 @@
|
|
1 |
# Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
## 1.2.1 (2020-02-13)
|
4 |
|
5 |
* Added: Permissions check for sysinfo download
|
1 |
# Changelog
|
2 |
|
3 |
+
## 1.2.4 (2020-05-25)
|
4 |
+
|
5 |
+
* Fixed: Incorrect textdomains in licensing module
|
6 |
+
* Fixed: CSS class typo
|
7 |
+
* Updated: Overall optimization
|
8 |
+
|
9 |
+
## 1.2.3 (2020-05-25)
|
10 |
+
|
11 |
+
* Fixed: Broken nonce
|
12 |
+
|
13 |
+
## 1.2.2 (2020-05-25)
|
14 |
+
|
15 |
+
* Fixed: VIP standards done right
|
16 |
+
|
17 |
## 1.2.1 (2020-02-13)
|
18 |
|
19 |
* Added: Permissions check for sysinfo download
|
{includes/libraries → vendor/widgitlabs}/simple-settings/CONTRIBUTING.md
RENAMED
File without changes
|
{includes/libraries → vendor/widgitlabs}/simple-settings/README.md
RENAMED
File without changes
|
vendor/widgitlabs/simple-settings/assets/css/admin.css
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Label styles
|
2 |
+
-------------------------------------------------------------- */
|
3 |
+
.simple-settings-options-table .form-table label {
|
4 |
+
color: #666;
|
5 |
+
font-size: 14px;
|
6 |
+
font-style: italic;
|
7 |
+
margin: 4px 0 0;
|
8 |
+
}
|
9 |
+
|
10 |
+
.simple-settings-options-table .form-table input[type = "radio"],
|
11 |
+
.simple-settings-options-table .form-table input[type = "checkbox"] {
|
12 |
+
vertical-align: text-bottom;
|
13 |
+
}
|
14 |
+
|
15 |
+
.simple-settings-options-table .form-table input[type = "radio"] + label,
|
16 |
+
.simple-settings-options-table .form-table input[type = "checkbox"] + label {
|
17 |
+
font-style: normal;
|
18 |
+
margin-top: 0;
|
19 |
+
}
|
20 |
+
|
21 |
+
.simple-settings-radio-wrap .description,
|
22 |
+
.simple-settings-multicheck-wrap .description {
|
23 |
+
color: #666;
|
24 |
+
display: inline-block;
|
25 |
+
font-size: 14px;
|
26 |
+
line-height: 1.4;
|
27 |
+
margin-top: 8px;
|
28 |
+
}
|
29 |
+
|
30 |
+
/* Fix color picker alignment
|
31 |
+
-------------------------------------------------------------- */
|
32 |
+
.simple-settings-color-picker-wrap .wp-picker-container .wp-color-result.button {
|
33 |
+
margin-top: -6px;
|
34 |
+
}
|
35 |
+
|
36 |
+
/* System info styles
|
37 |
+
-------------------------------------------------------------- */
|
38 |
+
.simple-settings-system-info {
|
39 |
+
background: none;
|
40 |
+
display: block;
|
41 |
+
font-family: Menlo, Monaco, monospace;
|
42 |
+
height: 400px;
|
43 |
+
overflow: auto;
|
44 |
+
white-space: pre;
|
45 |
+
width: 800px;
|
46 |
+
}
|
47 |
+
|
48 |
+
/* Tooltips
|
49 |
+
-------------------------------------------------------------- */
|
50 |
+
.simple-settings-help-tip {
|
51 |
+
cursor: help;
|
52 |
+
vertical-align: middle !important;
|
53 |
+
}
|
54 |
+
|
55 |
+
.simple-settings-ui-tooltip {
|
56 |
+
background: #333;
|
57 |
+
border-radius: 3px;
|
58 |
+
border-width: 1px;
|
59 |
+
box-shadow: 1px 1px 2px 1px rgba(214, 214, 214, 0.5);
|
60 |
+
color: #dedede;
|
61 |
+
max-width: 300px;
|
62 |
+
padding: 7px;
|
63 |
+
position: absolute;
|
64 |
+
text-rendering: optimizeLegibility;
|
65 |
+
text-shadow: none;
|
66 |
+
z-index: 9999;
|
67 |
+
}
|
68 |
+
|
69 |
+
.simple-settings-ui-tooltip strong {
|
70 |
+
font-weight: bolder;
|
71 |
+
}
|
vendor/widgitlabs/simple-settings/assets/css/admin.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.simple-settings-options-table .form-table label{color:#666;font-size:14px;font-style:italic;margin:4px 0 0}.simple-settings-options-table .form-table input[type=checkbox],.simple-settings-options-table .form-table input[type=radio]{vertical-align:text-bottom}.simple-settings-options-table .form-table input[type=checkbox]+label,.simple-settings-options-table .form-table input[type=radio]+label{font-style:normal;margin-top:0}.simple-settings-multicheck-wrap .description,.simple-settings-radio-wrap .description{color:#666;display:inline-block;font-size:14px;line-height:1.4;margin-top:8px}.simple-settings-color-picker-wrap .wp-picker-container .wp-color-result.button{margin-top:-6px}.simple-settings-system-info{background:0 0;display:block;font-family:Menlo,Monaco,monospace;height:400px;overflow:auto;white-space:pre;width:800px}.simple-settings-help-tip{cursor:help;vertical-align:middle!important}.simple-settings-ui-tooltip{background:#333;border-radius:3px;border-width:1px;box-shadow:1px 1px 2px 1px rgba(214,214,214,.5);color:#dedede;max-width:300px;padding:7px;position:absolute;text-rendering:optimizeLegibility;text-shadow:none;z-index:9999}.simple-settings-ui-tooltip strong{font-weight:bolder}
|
{includes/libraries → vendor/widgitlabs}/simple-settings/assets/css/jquery-ui-classic.min.css
RENAMED
File without changes
|
{includes/libraries → vendor/widgitlabs}/simple-settings/assets/css/jquery-ui-fresh.min.css
RENAMED
File without changes
|
{includes/libraries → vendor/widgitlabs}/simple-settings/assets/js/admin.js
RENAMED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*global jQuery, document, window, wp,
|
2 |
jQuery(document).ready(function ($) {
|
3 |
'use strict';
|
4 |
|
@@ -15,7 +15,7 @@ jQuery(document).ready(function ($) {
|
|
15 |
// Setup CodeMirror
|
16 |
if ($('.simple-settings-html').length) {
|
17 |
$('.simple-settings-html').each(function (index, elem) {
|
18 |
-
CodeMirror.fromTextArea(elem, {
|
19 |
lineNumbers: true,
|
20 |
mode: 'text/html',
|
21 |
showCursorWhenSelecting: true
|
@@ -28,6 +28,7 @@ jQuery(document).ready(function ($) {
|
|
28 |
content: function () {
|
29 |
return $(this).prop('title');
|
30 |
},
|
|
|
31 |
position: {
|
32 |
my: 'center top',
|
33 |
at: 'center bottom+10',
|
1 |
+
/*global jQuery, document, window, wp, simple_settings_vars*/
|
2 |
jQuery(document).ready(function ($) {
|
3 |
'use strict';
|
4 |
|
15 |
// Setup CodeMirror
|
16 |
if ($('.simple-settings-html').length) {
|
17 |
$('.simple-settings-html').each(function (index, elem) {
|
18 |
+
wp.CodeMirror.fromTextArea(elem, {
|
19 |
lineNumbers: true,
|
20 |
mode: 'text/html',
|
21 |
showCursorWhenSelecting: true
|
28 |
content: function () {
|
29 |
return $(this).prop('title');
|
30 |
},
|
31 |
+
tooltipClass: 'simple-settings-ui-tooltip',
|
32 |
position: {
|
33 |
my: 'center top',
|
34 |
at: 'center bottom+10',
|
vendor/widgitlabs/simple-settings/assets/js/admin.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready((function($){"use strict";var file_frame;($(".simple-settings-color-picker").length&&$(".simple-settings-color-picker").wpColorPicker(),$(".simple-settings-select2").length&&$(".simple-settings-select2").select2(),$(".simple-settings-html").length&&$(".simple-settings-html").each((function(index,elem){wp.CodeMirror.fromTextArea(elem,{lineNumbers:!0,mode:"text/html",showCursorWhenSelecting:!0})})),$(".simple-settings-help-tip").tooltip({content:function(){return $(this).prop("title")},tooltipClass:"simple-settings-ui-tooltip",position:{my:"center top",at:"center bottom+10",collision:"flipfit"},hide:{duration:200},show:{duration:200}}),$("."+simple_settings_vars.func+"_settings_upload_button").length)&&($("body").on("click","."+simple_settings_vars.func+"_settings_upload_button",(function(e){e.preventDefault();var button=$(this);window.formfield=$(this).parent().prev(),file_frame?file_frame.open():(wp.media.frames.file_frame=wp.media({frame:"post",state:"insert",title:button.data("uploader_title"),button:{text:button.data("uploader_button_text")},multiple:!1}),(file_frame=wp.media.frames.file_frame).on("menu:render:default",(function(view){var views={};view.unset("library-separator"),view.unset("gallery"),view.unset("featured-image"),view.unset("embed"),view.set(views)})),file_frame.on("insert",(function(){var selection;file_frame.state().get("selection").each((function(attachment){attachment=attachment.toJSON(),window.formfield.val(attachment.url)}))})),file_frame.open())})),window.formfield="")}));
|
{includes/libraries → vendor/widgitlabs}/simple-settings/class-simple-settings.php
RENAMED
@@ -28,7 +28,7 @@ class Simple_Settings {
|
|
28 |
* @access private
|
29 |
* @since 1.0.0
|
30 |
*/
|
31 |
-
private $version = '1.2.
|
32 |
|
33 |
|
34 |
/**
|
@@ -144,7 +144,7 @@ class Simple_Settings {
|
|
144 |
add_action( 'admin_init', array( $this, 'process_actions' ) );
|
145 |
|
146 |
// Handle tooltips.
|
147 |
-
|
148 |
}
|
149 |
|
150 |
|
@@ -208,7 +208,7 @@ class Simple_Settings {
|
|
208 |
|
209 |
$section = isset( $get['section'] ) && ! empty( $registered_sections ) && array_key_exists( $get['section'], $registered_sections ) ? $get['section'] : $key;
|
210 |
?>
|
211 |
-
<div class="wrap">
|
212 |
<?php if ( $this->show_title ) { ?>
|
213 |
<h2><?php echo esc_html( $this->page_title ); ?></h2>
|
214 |
<?php } ?>
|
@@ -226,9 +226,8 @@ class Simple_Settings {
|
|
226 |
$tab_url = remove_query_arg( 'section', $tab_url );
|
227 |
|
228 |
$active = $active_tab === $tab_id ? ' nav-tab-active' : '';
|
229 |
-
|
230 |
-
<a href="
|
231 |
-
<?php
|
232 |
}
|
233 |
?>
|
234 |
</h2>
|
@@ -434,6 +433,8 @@ class Simple_Settings {
|
|
434 |
return false;
|
435 |
}
|
436 |
|
|
|
|
|
437 |
// Fetch a clean copy of the options array.
|
438 |
$options = get_option( $this->func . '_settings' );
|
439 |
|
@@ -442,11 +443,15 @@ class Simple_Settings {
|
|
442 |
unset( $options[ $key ] );
|
443 |
}
|
444 |
|
|
|
|
|
|
|
|
|
|
|
445 |
$did_update = update_option( $this->func . '_settings', $options );
|
446 |
|
447 |
// Update the global.
|
448 |
if ( $did_update ) {
|
449 |
-
global ${$this->func . '_options'};
|
450 |
${$this->func . '_options'} = $options;
|
451 |
}
|
452 |
|
@@ -509,41 +514,44 @@ class Simple_Settings {
|
|
509 |
continue;
|
510 |
}
|
511 |
|
512 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
513 |
|
514 |
add_settings_field(
|
515 |
$this->func . '_settings[' . $option['id'] . ']',
|
516 |
-
$name,
|
517 |
function_exists( $this->func . '_' . $option['type'] . '_callback' ) ? $this->func . '_' . $option['type'] . '_callback' : ( method_exists( $this, $option['type'] . '_callback' ) ? array( $this, $option['type'] . '_callback' ) : array( $this, 'missing_callback' ) ),
|
518 |
$this->func . '_settings_' . $tab . '_' . $section,
|
519 |
$this->func . '_settings_' . $tab . '_' . $section,
|
520 |
apply_filters(
|
521 |
$this->func . '_settings_allowed_args',
|
522 |
-
|
523 |
-
'section' => $section,
|
524 |
-
'id' => isset( $option['id'] ) ? $option['id'] : null,
|
525 |
-
'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',
|
526 |
-
'name' => isset( $option['name'] ) ? $option['name'] : null,
|
527 |
-
'size' => isset( $option['size'] ) ? $option['size'] : null,
|
528 |
-
'options' => isset( $option['options'] ) ? $option['options'] : '',
|
529 |
-
'std' => isset( $option['std'] ) ? $option['std'] : '',
|
530 |
-
'min' => isset( $option['min'] ) ? $option['min'] : null,
|
531 |
-
'max' => isset( $option['max'] ) ? $option['max'] : null,
|
532 |
-
'step' => isset( $option['step'] ) ? $option['step'] : null,
|
533 |
-
'select2' => isset( $option['select2'] ) ? $option['select2'] : null,
|
534 |
-
'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,
|
535 |
-
'multiple' => isset( $option['multiple'] ) ? $option['multiple'] : null,
|
536 |
-
'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,
|
537 |
-
'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,
|
538 |
-
'disabled' => isset( $option['disabled'] ) ? $option['disabled'] : false,
|
539 |
-
'buttons' => isset( $option['buttons'] ) ? $option['buttons'] : null,
|
540 |
-
'wpautop' => isset( $option['wpautop'] ) ? $option['wpautop'] : null,
|
541 |
-
'teeny' => isset( $option['teeny'] ) ? $option['teeny'] : null,
|
542 |
-
'tab' => isset( $option['tab'] ) ? $option['tab'] : null,
|
543 |
-
'tooltip_title' => isset( $option['tooltip_title'] ) ? $option['tooltip_title'] : false,
|
544 |
-
'tooltip_desc' => isset( $option['tooltip_desc'] ) ? $option['tooltip_desc'] : false,
|
545 |
-
'field_class' => isset( $option['field_class'] ) ? $option['field_class'] : '',
|
546 |
-
),
|
547 |
$option
|
548 |
)
|
549 |
);
|
@@ -637,7 +645,7 @@ class Simple_Settings {
|
|
637 |
}
|
638 |
break;
|
639 |
default:
|
640 |
-
if ( array_key_exists( $key, $input ) && empty( $input[ $key ] ) || ( array_key_exists( $key, $output ) && ! array_key_exists( $key, $input ) ) ) {
|
641 |
unset( $output[ $key ] );
|
642 |
}
|
643 |
break;
|
@@ -803,7 +811,9 @@ class Simple_Settings {
|
|
803 |
* @return void
|
804 |
*/
|
805 |
public function header_callback( $args ) {
|
|
|
806 |
do_action( $this->func . '_after_setting_output', '', $args );
|
|
|
807 |
}
|
808 |
|
809 |
|
@@ -819,15 +829,19 @@ class Simple_Settings {
|
|
819 |
public function checkbox_callback( $args ) {
|
820 |
global ${$this->func . '_options'};
|
821 |
|
822 |
-
$name =
|
823 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
824 |
$checked = isset( ${$this->func . '_options'}[ $args['id'] ] ) ? checked( 1, ${$this->func . '_options'}[ $args['id'] ], false ) : '';
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
<
|
829 |
-
|
|
|
|
|
830 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
831 |
}
|
832 |
|
833 |
|
@@ -837,7 +851,7 @@ class Simple_Settings {
|
|
837 |
* @access public
|
838 |
* @since 1.0.0
|
839 |
* @param array $args Arguments passed by the settings.
|
840 |
-
* @global array ${$this->func . '_options'} The
|
841 |
* @return void
|
842 |
*/
|
843 |
public function color_callback( $args ) {
|
@@ -851,11 +865,15 @@ class Simple_Settings {
|
|
851 |
|
852 |
$default = isset( $args['std'] ) ? $args['std'] : '';
|
853 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
|
|
|
|
858 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
859 |
}
|
860 |
|
861 |
|
@@ -868,7 +886,12 @@ class Simple_Settings {
|
|
868 |
* @return void
|
869 |
*/
|
870 |
public function descriptive_text_callback( $args ) {
|
|
|
|
|
|
|
871 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
872 |
}
|
873 |
|
874 |
|
@@ -878,7 +901,7 @@ class Simple_Settings {
|
|
878 |
* @access public
|
879 |
* @since 1.0.0
|
880 |
* @param array $args Arguments passed by the setting.
|
881 |
-
* @global array ${$this->func . '_options'} The
|
882 |
* @return void
|
883 |
*/
|
884 |
public function editor_callback( $args ) {
|
@@ -899,6 +922,9 @@ class Simple_Settings {
|
|
899 |
$buttons = isset( $args['buttons'] ) ? $args['buttons'] : true;
|
900 |
$teeny = isset( $args['teeny'] ) ? $args['teeny'] : false;
|
901 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
|
|
|
|
|
|
902 |
|
903 |
wp_editor(
|
904 |
stripslashes( $value ),
|
@@ -912,10 +938,12 @@ class Simple_Settings {
|
|
912 |
'editor_class' => $class,
|
913 |
)
|
914 |
);
|
915 |
-
|
916 |
-
<
|
917 |
-
|
918 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
919 |
}
|
920 |
|
921 |
|
@@ -925,7 +953,7 @@ class Simple_Settings {
|
|
925 |
* @access public
|
926 |
* @since 1.0.0
|
927 |
* @param array $args Arguments passed by the setting.
|
928 |
-
* @global array ${$this->func . '_options'} The
|
929 |
* @return void
|
930 |
*/
|
931 |
public function html_callback( $args ) {
|
@@ -936,11 +964,16 @@ class Simple_Settings {
|
|
936 |
} else {
|
937 |
$value = isset( $args['std'] ) ? $args['std'] : '';
|
938 |
}
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
|
|
|
|
|
|
943 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
944 |
}
|
945 |
|
946 |
|
@@ -950,33 +983,37 @@ class Simple_Settings {
|
|
950 |
* @access public
|
951 |
* @since 1.0.0
|
952 |
* @param array $args Arguments passed by the setting.
|
953 |
-
* @global array ${$this->func . '_options'} The
|
954 |
* @return void
|
955 |
*/
|
956 |
public function multicheck_callback( $args ) {
|
957 |
global ${$this->func . '_options'};
|
958 |
|
959 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
|
|
960 |
|
961 |
if ( ! empty( $args['options'] ) ) {
|
962 |
-
|
963 |
-
<input type="hidden" name="
|
964 |
-
|
965 |
foreach ( $args['options'] as $key => $option ) {
|
966 |
if ( isset( ${$this->func . '_options'}[ $args['id'] ][ $key ] ) ) {
|
967 |
$enabled = $option;
|
968 |
} else {
|
969 |
$enabled = isset( $args['std'][ $key ] ) ? $args['std'][ $key ] : null;
|
970 |
}
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
|
|
975 |
}
|
976 |
-
|
977 |
-
<
|
978 |
-
|
979 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
980 |
}
|
981 |
}
|
982 |
|
@@ -987,7 +1024,7 @@ class Simple_Settings {
|
|
987 |
* @access public
|
988 |
* @since 1.0.0
|
989 |
* @param array $args Arguments passed by the setting.
|
990 |
-
* @global array ${$this->func . '_options'} The
|
991 |
* @return void
|
992 |
*/
|
993 |
public function number_callback( $args ) {
|
@@ -999,18 +1036,22 @@ class Simple_Settings {
|
|
999 |
$value = isset( $args['std'] ) ? $args['std'] : '';
|
1000 |
}
|
1001 |
|
1002 |
-
$name =
|
1003 |
$max = isset( $args['max'] ) ? $args['max'] : 999999;
|
1004 |
$min = isset( $args['min'] ) ? $args['min'] : 0;
|
1005 |
$step = isset( $args['step'] ) ? $args['step'] : 1;
|
1006 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1007 |
$readonly = true === $args['readonly'] ? ' readonly="readonly"' : '';
|
1008 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
|
|
|
|
1013 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1014 |
}
|
1015 |
|
1016 |
|
@@ -1020,7 +1061,7 @@ class Simple_Settings {
|
|
1020 |
* @access public
|
1021 |
* @since 1.0.0
|
1022 |
* @param array $args Arguments passed by the settings.
|
1023 |
-
* @global array ${$this->func . '_options'} The
|
1024 |
* @return void
|
1025 |
*/
|
1026 |
public function password_callback( $args ) {
|
@@ -1034,11 +1075,15 @@ class Simple_Settings {
|
|
1034 |
|
1035 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1036 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
|
|
|
|
1041 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1042 |
}
|
1043 |
|
1044 |
|
@@ -1048,7 +1093,7 @@ class Simple_Settings {
|
|
1048 |
* @access public
|
1049 |
* @since 1.0.0
|
1050 |
* @param array $args Arguments passed by the setting.
|
1051 |
-
* @global array ${$this->func . '_options'} The
|
1052 |
* @return void
|
1053 |
*/
|
1054 |
public function radio_callback( $args ) {
|
@@ -1056,25 +1101,29 @@ class Simple_Settings {
|
|
1056 |
|
1057 |
if ( ! empty( $args['options'] ) ) {
|
1058 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
|
|
1059 |
|
1060 |
-
|
1061 |
|
1062 |
foreach ( $args['options'] as $key => $option ) {
|
1063 |
$checked = false;
|
|
|
1064 |
|
1065 |
if ( isset( ${$this->func . '_options'}[ $args['id'] ] ) && ${$this->func . '_options'}[ $args['id'] ] === $key ) {
|
1066 |
$checked = true;
|
1067 |
} elseif ( isset( $args['std'] ) && $args['std'] === $key && ! isset( ${$this->func . '_options'}[ $args['id'] ] ) ) {
|
1068 |
$checked = true;
|
1069 |
}
|
1070 |
-
|
1071 |
-
<input name="
|
1072 |
-
<label for="
|
1073 |
-
<?php
|
1074 |
}
|
1075 |
-
|
1076 |
-
<
|
1077 |
-
|
|
|
|
|
|
|
1078 |
}
|
1079 |
}
|
1080 |
|
@@ -1085,7 +1134,7 @@ class Simple_Settings {
|
|
1085 |
* @access public
|
1086 |
* @since 1.0.0
|
1087 |
* @param array $args Arguments passed by the setting.
|
1088 |
-
* @global array ${$this->func . '_options'} The
|
1089 |
* @return void
|
1090 |
*/
|
1091 |
public function select_callback( $args ) {
|
@@ -1101,32 +1150,33 @@ class Simple_Settings {
|
|
1101 |
$select2 = isset( $args['select2'] ) ? 'simple-settings-select2' : '';
|
1102 |
$width = isset( $args['size'] ) ? ' style="width: ' . $args['size'] . '"' : '';
|
1103 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
|
|
1104 |
|
1105 |
-
$nonce = isset( $args['data']['nonce'] ) ? '
|
1106 |
|
1107 |
// If the field allows multiples, save as an array.
|
1108 |
$name_attr = $this->func . '_settings[' . $this->sanitize_key( $args['id'] ) . ']';
|
1109 |
$name_attr = ( $args['multiple'] ) ? $name_attr . '[]' : $name_attr;
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
|
|
1113 |
foreach ( $args['options'] as $option => $name ) {
|
1114 |
if ( ! $args['multiple'] ) {
|
1115 |
$selected = selected( $option, $value, false );
|
1116 |
-
|
1117 |
-
<option value="
|
1118 |
-
<?php
|
1119 |
} else {
|
1120 |
-
|
1121 |
-
<option value="<?php echo esc_attr( $option ); ?>" <?php echo ( ( in_array( $option, $value, true ) ) ? 'selected="true"' : '' ); ?>><?php echo esc_html( $name ); ?></option>
|
1122 |
-
<?php
|
1123 |
}
|
1124 |
}
|
1125 |
-
|
1126 |
-
</select>
|
1127 |
-
<label for="
|
1128 |
-
|
1129 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1130 |
}
|
1131 |
|
1132 |
|
@@ -1145,15 +1195,16 @@ class Simple_Settings {
|
|
1145 |
}
|
1146 |
|
1147 |
if ( ! isset( ${$this->func . '_options'}[ $args['tab'] ] ) || ( isset( ${$this->func . '_options'}[ $args['tab'] ] ) && isset( $_GET['tab'] ) && ${$this->func . '_options'}[ $args['tab'] ] === $_GET['tab'] ) ) {
|
1148 |
-
|
1149 |
-
<textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info
|
1150 |
-
<p class="submit">
|
1151 |
-
<input type="hidden" name="
|
1152 |
-
<a class="button button-primary" href="
|
1153 |
-
</p>
|
1154 |
-
|
1155 |
-
wp_nonce_field( esc_attr( $this->func ) . 'system-info-nonce', esc_attr( $this->func ) . 'system-info-nonce' );
|
1156 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1157 |
}
|
1158 |
}
|
1159 |
|
@@ -1163,7 +1214,7 @@ class Simple_Settings {
|
|
1163 |
*
|
1164 |
* @since 1.0.0
|
1165 |
* @param array $args Arguments passed by the setting.
|
1166 |
-
* @global array ${$this->func . '_options'} The
|
1167 |
* @return void
|
1168 |
*/
|
1169 |
public function text_callback( $args ) {
|
@@ -1175,17 +1226,21 @@ class Simple_Settings {
|
|
1175 |
$value = isset( $args['std'] ) ? $args['std'] : '';
|
1176 |
}
|
1177 |
|
1178 |
-
$name =
|
1179 |
$readonly = true === $args['readonly'] ? ' readonly="readonly"' : '';
|
1180 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1181 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1182 |
$disabled = ! empty( $args['disabled'] ) ? ' disabled="disabled"' : '';
|
1183 |
$placeholder = isset( $args['placeholder'] ) ? $args['placeholder'] : '';
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
|
|
|
|
1188 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1189 |
}
|
1190 |
|
1191 |
|
@@ -1194,7 +1249,7 @@ class Simple_Settings {
|
|
1194 |
*
|
1195 |
* @since 1.0.0
|
1196 |
* @param array $args Arguments passed by the setting.
|
1197 |
-
* @global array ${$this->func . '_options'} The
|
1198 |
* @return void
|
1199 |
*/
|
1200 |
public function textarea_callback( $args ) {
|
@@ -1207,11 +1262,15 @@ class Simple_Settings {
|
|
1207 |
}
|
1208 |
|
1209 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
|
|
|
|
1214 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1215 |
}
|
1216 |
|
1217 |
|
@@ -1220,7 +1279,7 @@ class Simple_Settings {
|
|
1220 |
*
|
1221 |
* @since 1.0.0
|
1222 |
* @param array $args Arguments passed by the setting.
|
1223 |
-
* @global array ${$this->func . '_options'} The
|
1224 |
* @return void
|
1225 |
*/
|
1226 |
public function upload_callback( $args ) {
|
@@ -1234,12 +1293,16 @@ class Simple_Settings {
|
|
1234 |
|
1235 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1236 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1237 |
-
|
1238 |
-
|
1239 |
-
<
|
1240 |
-
<
|
1241 |
-
|
|
|
|
|
1242 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1243 |
}
|
1244 |
|
1245 |
|
@@ -1249,7 +1312,7 @@ class Simple_Settings {
|
|
1249 |
* @access public
|
1250 |
* @since 1.0.0
|
1251 |
* @param array $args Arguments passed by the setting.
|
1252 |
-
* @global array ${$this->func . '_options'} The
|
1253 |
* @return void
|
1254 |
*/
|
1255 |
public function license_key_callback( $args ) {
|
@@ -1263,20 +1326,22 @@ class Simple_Settings {
|
|
1263 |
|
1264 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1265 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
|
|
|
|
1269 |
if ( get_option( $args['options']['is_valid_license_option'] ) ) {
|
1270 |
-
|
1271 |
-
<input type="submit" class="button-secondary" name="<?php echo esc_attr( $args['id'] ); ?>_deactivate" value="<?php esc_attr_e( 'Deactivate License', 'simple-settings' ); ?>"/>
|
1272 |
-
<?php
|
1273 |
}
|
1274 |
-
|
1275 |
-
<label for="
|
1276 |
-
|
1277 |
wp_nonce_field( $this->sanitize_key( $args['id'] ) . '-nonce', $this->sanitize_key( $args['id'] ) . '-nonce' );
|
1278 |
|
1279 |
do_action( $this->func . '_after_setting_output', $args );
|
|
|
|
|
1280 |
}
|
1281 |
|
1282 |
|
@@ -1298,11 +1363,11 @@ class Simple_Settings {
|
|
1298 |
* @access public
|
1299 |
* @since 1.0.0
|
1300 |
* @param array $args Arguments passed by the setting.
|
1301 |
-
* @return
|
1302 |
*/
|
1303 |
public function missing_callback( $args ) {
|
1304 |
// Translators: The passed ID that has no corresponding callback.
|
1305 |
-
|
1306 |
}
|
1307 |
|
1308 |
|
@@ -1336,8 +1401,8 @@ class Simple_Settings {
|
|
1336 |
* @return void
|
1337 |
*/
|
1338 |
public function process_actions() {
|
1339 |
-
if ( isset( $_REQUEST[ $this->
|
1340 |
-
check_admin_referer( $this->
|
1341 |
}
|
1342 |
|
1343 |
$post = wp_unslash( $_POST );
|
@@ -1374,7 +1439,6 @@ class Simple_Settings {
|
|
1374 |
$ui_style = ( get_user_option( 'admin_color' ) === 'classic' ) ? 'classic' : 'fresh';
|
1375 |
$url_path = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) );
|
1376 |
$select2_cdn = 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/';
|
1377 |
-
$cm_cdn = 'https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.46.0/';
|
1378 |
|
1379 |
wp_enqueue_style( 'wp-color-picker' );
|
1380 |
wp_enqueue_script( 'wp-color-picker' );
|
@@ -1386,20 +1450,13 @@ class Simple_Settings {
|
|
1386 |
wp_enqueue_script( 'thickbox' );
|
1387 |
wp_enqueue_style( 'select2', $select2_cdn . 'css/select2.min.css', array(), '4.0.7' );
|
1388 |
wp_enqueue_script( 'select2', $select2_cdn . 'js/select2.min.js', array( 'jquery' ), '4.0.7', true );
|
|
|
|
|
1389 |
|
1390 |
-
wp_enqueue_style( $
|
1391 |
-
wp_enqueue_script( $
|
1392 |
-
wp_enqueue_script( $this->slug . '-cm-html', $cm_cdn . 'mode/htmlmixed/htmlmixed.js', array( 'jquery', $this->slug . '-cm' ), '5.46.0', true );
|
1393 |
-
wp_enqueue_script( $this->slug . '-cm-xml', $cm_cdn . 'mode/xml/xml.js', array( 'jquery', $this->slug . '-cm' ), '5.46.0', true );
|
1394 |
-
wp_enqueue_script( $this->slug . '-cm-js', $cm_cdn . 'mode/javascript/javascript.js', array( 'jquery', $this->slug . '-cm' ), '5.46.0', true );
|
1395 |
-
wp_enqueue_script( $this->slug . '-cm-css', $cm_cdn . 'mode/css/css.js', array( 'jquery', $this->slug . '-cm' ), '5.46.0', true );
|
1396 |
-
wp_enqueue_script( $this->slug . '-cm-php', $cm_cdn . 'mode/php/php.js', array( 'jquery', $this->slug . '-cm' ), '5.46.0', true );
|
1397 |
-
wp_enqueue_script( $this->slug . '-cm-clike', $cm_cdn . 'mode/clike/clike.js', array( 'jquery', $this->slug . '-cm' ), '5.46.0', true );
|
1398 |
-
|
1399 |
-
wp_enqueue_style( $this->slug . '-simple-settings', $url_path . '/assets/css/admin' . $suffix . '.css', array(), $this->version );
|
1400 |
-
wp_enqueue_script( $this->slug . '-simple-settings', $url_path . '/assets/js/admin' . $suffix . '.js', array( 'jquery' ), $this->version, true );
|
1401 |
wp_localize_script(
|
1402 |
-
|
1403 |
'simple_settings_vars',
|
1404 |
apply_filters(
|
1405 |
$this->func . 'localize_script',
|
@@ -1424,8 +1481,20 @@ class Simple_Settings {
|
|
1424 |
public function add_setting_tooltip( $args ) {
|
1425 |
if ( ! empty( $args['tooltip_title'] ) && ! empty( $args['tooltip_desc'] ) ) {
|
1426 |
?>
|
1427 |
-
<span alt="f223" class="simple-settings-help-tip dashicons dashicons-editor-help" title="<strong><?php echo
|
1428 |
<?php
|
1429 |
}
|
1430 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1431 |
}
|
28 |
* @access private
|
29 |
* @since 1.0.0
|
30 |
*/
|
31 |
+
private $version = '1.2.4';
|
32 |
|
33 |
|
34 |
/**
|
144 |
add_action( 'admin_init', array( $this, 'process_actions' ) );
|
145 |
|
146 |
// Handle tooltips.
|
147 |
+
add_filter( $this->func . '_after_setting_output', array( $this, 'add_setting_tooltip' ), 10, 2 );
|
148 |
}
|
149 |
|
150 |
|
208 |
|
209 |
$section = isset( $get['section'] ) && ! empty( $registered_sections ) && array_key_exists( $get['section'], $registered_sections ) ? $get['section'] : $key;
|
210 |
?>
|
211 |
+
<div class="wrap simple-settings-page">
|
212 |
<?php if ( $this->show_title ) { ?>
|
213 |
<h2><?php echo esc_html( $this->page_title ); ?></h2>
|
214 |
<?php } ?>
|
226 |
$tab_url = remove_query_arg( 'section', $tab_url );
|
227 |
|
228 |
$active = $active_tab === $tab_id ? ' nav-tab-active' : '';
|
229 |
+
|
230 |
+
echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $tab_name ) . '" class="nav-tab' . esc_attr( $active ) . '">' . esc_html( $tab_name ) . '</a>';
|
|
|
231 |
}
|
232 |
?>
|
233 |
</h2>
|
433 |
return false;
|
434 |
}
|
435 |
|
436 |
+
global ${$this->func . '_options'};
|
437 |
+
|
438 |
// Fetch a clean copy of the options array.
|
439 |
$options = get_option( $this->func . '_settings' );
|
440 |
|
443 |
unset( $options[ $key ] );
|
444 |
}
|
445 |
|
446 |
+
// Remove the option from the global.
|
447 |
+
if ( isset( ${$this->func . '_options'}[ $key ] ) ) {
|
448 |
+
unset( ${$this->func . '_options'}[ $key ] );
|
449 |
+
}
|
450 |
+
|
451 |
$did_update = update_option( $this->func . '_settings', $options );
|
452 |
|
453 |
// Update the global.
|
454 |
if ( $did_update ) {
|
|
|
455 |
${$this->func . '_options'} = $options;
|
456 |
}
|
457 |
|
514 |
continue;
|
515 |
}
|
516 |
|
517 |
+
$args = wp_parse_args(
|
518 |
+
$option,
|
519 |
+
array(
|
520 |
+
'section' => $section,
|
521 |
+
'id' => null,
|
522 |
+
'desc' => '',
|
523 |
+
'name' => '',
|
524 |
+
'size' => null,
|
525 |
+
'options' => '',
|
526 |
+
'std' => '',
|
527 |
+
'min' => null,
|
528 |
+
'max' => null,
|
529 |
+
'step' => null,
|
530 |
+
'select2' => null,
|
531 |
+
'multiple' => null,
|
532 |
+
'placeholder' => null,
|
533 |
+
'allow_blank' => true,
|
534 |
+
'readonly' => false,
|
535 |
+
'disabled' => false,
|
536 |
+
'buttons' => null,
|
537 |
+
'wpautop' => null,
|
538 |
+
'teeny' => null,
|
539 |
+
'tab' => null,
|
540 |
+
'tooltip_title' => false,
|
541 |
+
'tooltip_desc' => false,
|
542 |
+
'field_class' => '',
|
543 |
+
)
|
544 |
+
);
|
545 |
|
546 |
add_settings_field(
|
547 |
$this->func . '_settings[' . $option['id'] . ']',
|
548 |
+
$args['name'],
|
549 |
function_exists( $this->func . '_' . $option['type'] . '_callback' ) ? $this->func . '_' . $option['type'] . '_callback' : ( method_exists( $this, $option['type'] . '_callback' ) ? array( $this, $option['type'] . '_callback' ) : array( $this, 'missing_callback' ) ),
|
550 |
$this->func . '_settings_' . $tab . '_' . $section,
|
551 |
$this->func . '_settings_' . $tab . '_' . $section,
|
552 |
apply_filters(
|
553 |
$this->func . '_settings_allowed_args',
|
554 |
+
$args,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
555 |
$option
|
556 |
)
|
557 |
);
|
645 |
}
|
646 |
break;
|
647 |
default:
|
648 |
+
if ( ( array_key_exists( $key, $input ) && empty( $input[ $key ] ) ) || ( array_key_exists( $key, $output ) && ! array_key_exists( $key, $input ) ) ) {
|
649 |
unset( $output[ $key ] );
|
650 |
}
|
651 |
break;
|
811 |
* @return void
|
812 |
*/
|
813 |
public function header_callback( $args ) {
|
814 |
+
echo '<div class="simple-settings-header-wrap">';
|
815 |
do_action( $this->func . '_after_setting_output', '', $args );
|
816 |
+
echo '</div>';
|
817 |
}
|
818 |
|
819 |
|
829 |
public function checkbox_callback( $args ) {
|
830 |
global ${$this->func . '_options'};
|
831 |
|
832 |
+
$name = $this->func . '_settings[' . $this->sanitize_key( $args['id'] ) . ']';
|
833 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
834 |
$checked = isset( ${$this->func . '_options'}[ $args['id'] ] ) ? checked( 1, ${$this->func . '_options'}[ $args['id'] ], false ) : '';
|
835 |
+
$id = $this->sanitize_key( $args['id'] );
|
836 |
+
|
837 |
+
echo '<div class="simple-settings-checkbox-wrap">';
|
838 |
+
echo '<input type="hidden" name="' . esc_attr( $name ) . '" value="-1" />';
|
839 |
+
echo '<input type="checkbox" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $name ) . '" value="1" ' . esc_attr( $checked ) . ' class="' . esc_attr( $class ) . '"/> ';
|
840 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
841 |
+
|
842 |
do_action( $this->func . '_after_setting_output', $args );
|
843 |
+
|
844 |
+
echo '</div>';
|
845 |
}
|
846 |
|
847 |
|
851 |
* @access public
|
852 |
* @since 1.0.0
|
853 |
* @param array $args Arguments passed by the settings.
|
854 |
+
* @global array ${$this->func . '_options'} The plugin options
|
855 |
* @return void
|
856 |
*/
|
857 |
public function color_callback( $args ) {
|
865 |
|
866 |
$default = isset( $args['std'] ) ? $args['std'] : '';
|
867 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
868 |
+
$id = $this->sanitize_key( $args['id'] );
|
869 |
+
|
870 |
+
echo '<div class="simple-settings-color-wrap">';
|
871 |
+
echo '<input type="text" class="simple-settings-color-picker ' . esc_attr( $class ) . '" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $args['id'] ) . ']" value="' . esc_attr( $value ) . '" data-default-color="' . esc_attr( $default ) . '" /> ';
|
872 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '></label>';
|
873 |
+
|
874 |
do_action( $this->func . '_after_setting_output', $args );
|
875 |
+
|
876 |
+
echo '</div>';
|
877 |
}
|
878 |
|
879 |
|
886 |
* @return void
|
887 |
*/
|
888 |
public function descriptive_text_callback( $args ) {
|
889 |
+
echo '<div class="simple-settings-descriptive-text-wrap">';
|
890 |
+
echo wp_kses_post( $args['desc'] );
|
891 |
+
|
892 |
do_action( $this->func . '_after_setting_output', $args );
|
893 |
+
|
894 |
+
echo '</div>';
|
895 |
}
|
896 |
|
897 |
|
901 |
* @access public
|
902 |
* @since 1.0.0
|
903 |
* @param array $args Arguments passed by the setting.
|
904 |
+
* @global array ${$this->func . '_options'} The plugin options
|
905 |
* @return void
|
906 |
*/
|
907 |
public function editor_callback( $args ) {
|
922 |
$buttons = isset( $args['buttons'] ) ? $args['buttons'] : true;
|
923 |
$teeny = isset( $args['teeny'] ) ? $args['teeny'] : false;
|
924 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
925 |
+
$id = $this->sanitize_key( $args['id'] );
|
926 |
+
|
927 |
+
echo '<div class="simple-settings-editor-wrap">';
|
928 |
|
929 |
wp_editor(
|
930 |
stripslashes( $value ),
|
938 |
'editor_class' => $class,
|
939 |
)
|
940 |
);
|
941 |
+
|
942 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
943 |
+
|
944 |
do_action( $this->func . '_after_setting_output', $args );
|
945 |
+
|
946 |
+
echo '</div>';
|
947 |
}
|
948 |
|
949 |
|
953 |
* @access public
|
954 |
* @since 1.0.0
|
955 |
* @param array $args Arguments passed by the setting.
|
956 |
+
* @global array ${$this->func . '_options'} The plugin options
|
957 |
* @return void
|
958 |
*/
|
959 |
public function html_callback( $args ) {
|
964 |
} else {
|
965 |
$value = isset( $args['std'] ) ? $args['std'] : '';
|
966 |
}
|
967 |
+
|
968 |
+
$id = $this->sanitize_key( $args['id'] );
|
969 |
+
|
970 |
+
echo '<div class="simple-settings-html-wrap">';
|
971 |
+
echo '<textarea class="large-text simple-settings-html" cols="50" rows="5" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . esc_textarea( $value ) . '</textarea> ';
|
972 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
973 |
+
|
974 |
do_action( $this->func . '_after_setting_output', $args );
|
975 |
+
|
976 |
+
echo '</div>';
|
977 |
}
|
978 |
|
979 |
|
983 |
* @access public
|
984 |
* @since 1.0.0
|
985 |
* @param array $args Arguments passed by the setting.
|
986 |
+
* @global array ${$this->func . '_options'} The plugin options
|
987 |
* @return void
|
988 |
*/
|
989 |
public function multicheck_callback( $args ) {
|
990 |
global ${$this->func . '_options'};
|
991 |
|
992 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
993 |
+
$id = $this->sanitize_key( $args['id'] );
|
994 |
|
995 |
if ( ! empty( $args['options'] ) ) {
|
996 |
+
echo '<div class="simple-settings-multicheck-wrap">';
|
997 |
+
echo '<input type="hidden" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" value="-1" />';
|
998 |
+
|
999 |
foreach ( $args['options'] as $key => $option ) {
|
1000 |
if ( isset( ${$this->func . '_options'}[ $args['id'] ][ $key ] ) ) {
|
1001 |
$enabled = $option;
|
1002 |
} else {
|
1003 |
$enabled = isset( $args['std'][ $key ] ) ? $args['std'][ $key ] : null;
|
1004 |
}
|
1005 |
+
|
1006 |
+
$key = $this->sanitize_key( $key );
|
1007 |
+
|
1008 |
+
echo '<input name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . '][' . esc_attr( $key ) . ']" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . '][' . esc_attr( $key ) . ']" class="' . esc_attr( $class ) . '" type="checkbox" value="' . esc_attr( $option ) . '" ' . checked( $option, $enabled, false ) . ' /> ';
|
1009 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . '][' . esc_attr( $key ) . ']">' . wp_kses_post( $option ) . '</label><br />';
|
1010 |
}
|
1011 |
+
|
1012 |
+
echo '<span class="description">' . wp_kses_post( $args['desc'] ) . '</span>';
|
1013 |
+
|
1014 |
do_action( $this->func . '_after_setting_output', $args );
|
1015 |
+
|
1016 |
+
echo '</div>';
|
1017 |
}
|
1018 |
}
|
1019 |
|
1024 |
* @access public
|
1025 |
* @since 1.0.0
|
1026 |
* @param array $args Arguments passed by the setting.
|
1027 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1028 |
* @return void
|
1029 |
*/
|
1030 |
public function number_callback( $args ) {
|
1036 |
$value = isset( $args['std'] ) ? $args['std'] : '';
|
1037 |
}
|
1038 |
|
1039 |
+
$name = esc_attr( $this->func ) . '_settings[' . esc_attr( $this->sanitize_key( $args['id'] ) ) . ']';
|
1040 |
$max = isset( $args['max'] ) ? $args['max'] : 999999;
|
1041 |
$min = isset( $args['min'] ) ? $args['min'] : 0;
|
1042 |
$step = isset( $args['step'] ) ? $args['step'] : 1;
|
1043 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1044 |
$readonly = true === $args['readonly'] ? ' readonly="readonly"' : '';
|
1045 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1046 |
+
$id = $this->sanitize_key( $args['id'] );
|
1047 |
+
|
1048 |
+
echo '<div class="simple-settings-number-wrap">';
|
1049 |
+
echo '<input type="number" step="' . esc_attr( $step ) . '" max="' . esc_attr( $max ) . '" min="' . esc_attr( $min ) . '" class="' . esc_attr( $class ) . ' ' . esc_attr( $this->sanitize_html_class( $size ) ) . '-text" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $name ) . '" value="' . esc_attr( $value ) . '"' . esc_attr( $readonly ) . ' /> ';
|
1050 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1051 |
+
|
1052 |
do_action( $this->func . '_after_setting_output', $args );
|
1053 |
+
|
1054 |
+
echo '</div>';
|
1055 |
}
|
1056 |
|
1057 |
|
1061 |
* @access public
|
1062 |
* @since 1.0.0
|
1063 |
* @param array $args Arguments passed by the settings.
|
1064 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1065 |
* @return void
|
1066 |
*/
|
1067 |
public function password_callback( $args ) {
|
1075 |
|
1076 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1077 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1078 |
+
$id = $this->sanitize_key( $args['id'] );
|
1079 |
+
|
1080 |
+
echo '<div class="simple-settings-password-wrap">';
|
1081 |
+
echo '<input type="password" class="' . esc_attr( $class ) . ' ' . esc_attr( $this->sanitize_html_class( $size ) ) . '-text" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" value="' . esc_attr( $value ) . '" /> ';
|
1082 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1083 |
+
|
1084 |
do_action( $this->func . '_after_setting_output', $args );
|
1085 |
+
|
1086 |
+
echo '</div>';
|
1087 |
}
|
1088 |
|
1089 |
|
1093 |
* @access public
|
1094 |
* @since 1.0.0
|
1095 |
* @param array $args Arguments passed by the setting.
|
1096 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1097 |
* @return void
|
1098 |
*/
|
1099 |
public function radio_callback( $args ) {
|
1101 |
|
1102 |
if ( ! empty( $args['options'] ) ) {
|
1103 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1104 |
+
$id = $this->sanitize_key( $args['id'] );
|
1105 |
|
1106 |
+
echo '<div class="simple-settings-radio-wrap">';
|
1107 |
|
1108 |
foreach ( $args['options'] as $key => $option ) {
|
1109 |
$checked = false;
|
1110 |
+
$key = $this->sanitize_key( $key );
|
1111 |
|
1112 |
if ( isset( ${$this->func . '_options'}[ $args['id'] ] ) && ${$this->func . '_options'}[ $args['id'] ] === $key ) {
|
1113 |
$checked = true;
|
1114 |
} elseif ( isset( $args['std'] ) && $args['std'] === $key && ! isset( ${$this->func . '_options'}[ $args['id'] ] ) ) {
|
1115 |
$checked = true;
|
1116 |
}
|
1117 |
+
|
1118 |
+
echo '<input name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . '][' . esc_attr( $key ) . ']" type="radio" class="' . esc_attr( $class ) . '" value="' . esc_attr( $key ) . '" ' . checked( true, $checked, false ) . ' /> ';
|
1119 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . '][' . esc_attr( $key ) . ']">' . esc_html( $option ) . '</label><br />';
|
|
|
1120 |
}
|
1121 |
+
|
1122 |
+
echo '<span class="description">' . wp_kses_post( $args['desc'] ) . '</span>';
|
1123 |
+
|
1124 |
+
do_action( $this->func . '_after_setting_output', $args );
|
1125 |
+
|
1126 |
+
echo '</div>';
|
1127 |
}
|
1128 |
}
|
1129 |
|
1134 |
* @access public
|
1135 |
* @since 1.0.0
|
1136 |
* @param array $args Arguments passed by the setting.
|
1137 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1138 |
* @return void
|
1139 |
*/
|
1140 |
public function select_callback( $args ) {
|
1150 |
$select2 = isset( $args['select2'] ) ? 'simple-settings-select2' : '';
|
1151 |
$width = isset( $args['size'] ) ? ' style="width: ' . $args['size'] . '"' : '';
|
1152 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1153 |
+
$id = $this->sanitize_key( $args['id'] );
|
1154 |
|
1155 |
+
$nonce = isset( $args['data']['nonce'] ) ? 'data-nonce="' . sanitize_text_field( $args['data']['nonce'] ) . '" ' : '';
|
1156 |
|
1157 |
// If the field allows multiples, save as an array.
|
1158 |
$name_attr = $this->func . '_settings[' . $this->sanitize_key( $args['id'] ) . ']';
|
1159 |
$name_attr = ( $args['multiple'] ) ? $name_attr . '[]' : $name_attr;
|
1160 |
+
|
1161 |
+
echo '<div class="simple-settings-select-wrap">';
|
1162 |
+
echo '<select ' . esc_attr( $nonce ) . 'id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $name_attr ) . '" class="' . esc_attr( $class ) . ' ' . esc_attr( $select2 ) . '" data-placeholder="' . esc_html( $placeholder ) . '"' . esc_attr( $width ) . ( ( $args['multiple'] ) ? ' multiple="true"' : '' ) . ' />';
|
1163 |
+
|
1164 |
foreach ( $args['options'] as $option => $name ) {
|
1165 |
if ( ! $args['multiple'] ) {
|
1166 |
$selected = selected( $option, $value, false );
|
1167 |
+
|
1168 |
+
echo '<option value="' . esc_attr( $option ) . '" ' . esc_attr( $selected ) . '>' . esc_html( $name ) . '</option>';
|
|
|
1169 |
} else {
|
1170 |
+
echo '<option value="' . esc_attr( $option ) . '" ' . ( ( in_array( $option, $value ) ) ? 'selected="true"' : '' ) . '>' . esc_html( $name ) . '</option>';
|
|
|
|
|
1171 |
}
|
1172 |
}
|
1173 |
+
|
1174 |
+
echo '</select> ';
|
1175 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1176 |
+
|
1177 |
do_action( $this->func . '_after_setting_output', $args );
|
1178 |
+
|
1179 |
+
echo '</div>';
|
1180 |
}
|
1181 |
|
1182 |
|
1195 |
}
|
1196 |
|
1197 |
if ( ! isset( ${$this->func . '_options'}[ $args['tab'] ] ) || ( isset( ${$this->func . '_options'}[ $args['tab'] ] ) && isset( $_GET['tab'] ) && ${$this->func . '_options'}[ $args['tab'] ] === $_GET['tab'] ) ) {
|
1198 |
+
echo '<div class="simple-settings-system-info-wrap">';
|
1199 |
+
echo '<textarea readonly="readonly" onclick="this.focus(); this.select()" class="simple-settings-system-info" id="' . esc_attr( $this->func ) . '-system-info" name="' . esc_attr( $this->func ) . '-system-info" title="' . esc_attr__( 'To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac).', 'simple-settings' ) . '">' . esc_html( $this->sysinfo->get_system_info() ) . '</textarea>';
|
1200 |
+
echo '<p class="submit">';
|
1201 |
+
echo '<input type="hidden" name="' . esc_attr( $this->slug ) . '-settings-action" value="download_system_info" />';
|
1202 |
+
echo '<a class="button button-primary" href="' . esc_url( add_query_arg( $this->slug . '-settings-action', 'download_system_info' ) ) . '">' . esc_html__( 'Download System Info File', 'simple-settings' ) . '</a>';
|
1203 |
+
echo '</p>';
|
1204 |
+
|
|
|
1205 |
do_action( $this->func . '_after_setting_output', $args );
|
1206 |
+
|
1207 |
+
echo '</div>';
|
1208 |
}
|
1209 |
}
|
1210 |
|
1214 |
*
|
1215 |
* @since 1.0.0
|
1216 |
* @param array $args Arguments passed by the setting.
|
1217 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1218 |
* @return void
|
1219 |
*/
|
1220 |
public function text_callback( $args ) {
|
1226 |
$value = isset( $args['std'] ) ? $args['std'] : '';
|
1227 |
}
|
1228 |
|
1229 |
+
$name = esc_attr( $this->func ) . '_settings[' . esc_attr( $this->sanitize_key( $args['id'] ) ) . ']';
|
1230 |
$readonly = true === $args['readonly'] ? ' readonly="readonly"' : '';
|
1231 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1232 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1233 |
$disabled = ! empty( $args['disabled'] ) ? ' disabled="disabled"' : '';
|
1234 |
$placeholder = isset( $args['placeholder'] ) ? $args['placeholder'] : '';
|
1235 |
+
$id = $this->sanitize_key( $args['id'] );
|
1236 |
+
|
1237 |
+
echo '<div class="simple-settings-text-wrap">';
|
1238 |
+
echo '<input type="text" class="' . esc_attr( $class ) . ' ' . esc_attr( $this->sanitize_html_class( $size ) ) . '-text" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $name ) . '" placeholder="' . esc_attr( $placeholder ) . '" value="' . esc_attr( $value ) . '"' . esc_attr( $readonly ) . '/> ';
|
1239 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1240 |
+
|
1241 |
do_action( $this->func . '_after_setting_output', $args );
|
1242 |
+
|
1243 |
+
echo '</div>';
|
1244 |
}
|
1245 |
|
1246 |
|
1249 |
*
|
1250 |
* @since 1.0.0
|
1251 |
* @param array $args Arguments passed by the setting.
|
1252 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1253 |
* @return void
|
1254 |
*/
|
1255 |
public function textarea_callback( $args ) {
|
1262 |
}
|
1263 |
|
1264 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1265 |
+
$id = $this->sanitize_key( $args['id'] );
|
1266 |
+
|
1267 |
+
echo '<div class="simple-settings-textarea-wrap">';
|
1268 |
+
echo '<textarea class="' . esc_attr( $class ) . ' large-text" cols="50" rows="5" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . esc_textarea( $value ) . '</textarea> ';
|
1269 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1270 |
+
|
1271 |
do_action( $this->func . '_after_setting_output', $args );
|
1272 |
+
|
1273 |
+
echo '</div>';
|
1274 |
}
|
1275 |
|
1276 |
|
1279 |
*
|
1280 |
* @since 1.0.0
|
1281 |
* @param array $args Arguments passed by the setting.
|
1282 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1283 |
* @return void
|
1284 |
*/
|
1285 |
public function upload_callback( $args ) {
|
1293 |
|
1294 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1295 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1296 |
+
$id = $this->sanitize_key( $args['id'] );
|
1297 |
+
|
1298 |
+
echo '<div class="simple-settings-upload-wrap">';
|
1299 |
+
echo '<input type="text" class="' . esc_attr( $class ) . ' ' . esc_attr( $this->sanitize_html_class( $size ) ) . '-text" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" value="' . esc_attr( $value ) . '" /> ';
|
1300 |
+
echo '<span> <input type="button" class="' . esc_attr( $this->func ) . '_settings_upload_button button-secondary" value="' . esc_attr__( 'Upload File', 'simple-settings' ) . '" /></span><br />';
|
1301 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1302 |
+
|
1303 |
do_action( $this->func . '_after_setting_output', $args );
|
1304 |
+
|
1305 |
+
echo '</div>';
|
1306 |
}
|
1307 |
|
1308 |
|
1312 |
* @access public
|
1313 |
* @since 1.0.0
|
1314 |
* @param array $args Arguments passed by the setting.
|
1315 |
+
* @global array ${$this->func . '_options'} The plugin options
|
1316 |
* @return void
|
1317 |
*/
|
1318 |
public function license_key_callback( $args ) {
|
1326 |
|
1327 |
$size = ( isset( $args['size'] ) && ! is_null( $args['size'] ) ) ? $args['size'] : 'regular';
|
1328 |
$class = $this->sanitize_html_class( $args['field_class'] );
|
1329 |
+
$id = $this->sanitize_key( $args['id'] );
|
1330 |
+
|
1331 |
+
echo '<div class="simple-settings-license-wrap">';
|
1332 |
+
echo '<input type="text" class="' . esc_attr( $class ) . ' ' . esc_attr( $this->sanitize_html_class( $size ) ) . '-text" id="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" name="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']" value="' . esc_attr( $value ) . '" /> ';
|
1333 |
+
|
1334 |
if ( get_option( $args['options']['is_valid_license_option'] ) ) {
|
1335 |
+
echo '<input type="submit" class="button-secondary" name="' . esc_attr( $args['id'] ) . '_deactivate" value="' . esc_attr__( 'Deactivate License', 'simple-settings' ) . '"/>';
|
|
|
|
|
1336 |
}
|
1337 |
+
|
1338 |
+
echo '<label for="' . esc_attr( $this->func ) . '_settings[' . esc_attr( $id ) . ']">' . wp_kses_post( $args['desc'] ) . '</label>';
|
1339 |
+
|
1340 |
wp_nonce_field( $this->sanitize_key( $args['id'] ) . '-nonce', $this->sanitize_key( $args['id'] ) . '-nonce' );
|
1341 |
|
1342 |
do_action( $this->func . '_after_setting_output', $args );
|
1343 |
+
|
1344 |
+
echo '</div>';
|
1345 |
}
|
1346 |
|
1347 |
|
1363 |
* @access public
|
1364 |
* @since 1.0.0
|
1365 |
* @param array $args Arguments passed by the setting.
|
1366 |
+
* @return void
|
1367 |
*/
|
1368 |
public function missing_callback( $args ) {
|
1369 |
// Translators: The passed ID that has no corresponding callback.
|
1370 |
+
printf( esc_html__( 'The callback function used for the <strong>%s</strong> setting is missing.', 'simple-settings' ), esc_attr( $args['id'] ) );
|
1371 |
}
|
1372 |
|
1373 |
|
1401 |
* @return void
|
1402 |
*/
|
1403 |
public function process_actions() {
|
1404 |
+
if ( isset( $_REQUEST[ $this->func . '_settings_nonce' ] ) ) {
|
1405 |
+
check_admin_referer( $this->func . '_settings_nonce', $this->func . '_settings_nonce' );
|
1406 |
}
|
1407 |
|
1408 |
$post = wp_unslash( $_POST );
|
1439 |
$ui_style = ( get_user_option( 'admin_color' ) === 'classic' ) ? 'classic' : 'fresh';
|
1440 |
$url_path = str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) );
|
1441 |
$select2_cdn = 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.7/';
|
|
|
1442 |
|
1443 |
wp_enqueue_style( 'wp-color-picker' );
|
1444 |
wp_enqueue_script( 'wp-color-picker' );
|
1450 |
wp_enqueue_script( 'thickbox' );
|
1451 |
wp_enqueue_style( 'select2', $select2_cdn . 'css/select2.min.css', array(), '4.0.7' );
|
1452 |
wp_enqueue_script( 'select2', $select2_cdn . 'js/select2.min.js', array( 'jquery' ), '4.0.7', true );
|
1453 |
+
wp_enqueue_script( 'wp-codemirror' );
|
1454 |
+
wp_enqueue_style( 'wp-codemirror' );
|
1455 |
|
1456 |
+
wp_enqueue_style( 'simple-settings', $url_path . '/assets/css/admin' . $suffix . '.css', array(), $this->version );
|
1457 |
+
wp_enqueue_script( 'simple-settings', $url_path . '/assets/js/admin' . $suffix . '.js', array( 'jquery' ), $this->version, true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1458 |
wp_localize_script(
|
1459 |
+
'simple-settings',
|
1460 |
'simple_settings_vars',
|
1461 |
apply_filters(
|
1462 |
$this->func . 'localize_script',
|
1481 |
public function add_setting_tooltip( $args ) {
|
1482 |
if ( ! empty( $args['tooltip_title'] ) && ! empty( $args['tooltip_desc'] ) ) {
|
1483 |
?>
|
1484 |
+
<span alt="f223" class="simple-settings-help-tip dashicons dashicons-editor-help" title="<strong><?php echo esc_html( $args['tooltip_title'] ); ?></strong>: <?php echo esc_html( $args['tooltip_desc'] ); ?>"></span>
|
1485 |
<?php
|
1486 |
}
|
1487 |
}
|
1488 |
+
|
1489 |
+
|
1490 |
+
/**
|
1491 |
+
* Get the current library version
|
1492 |
+
*
|
1493 |
+
* @access public
|
1494 |
+
* @since 1.2.1
|
1495 |
+
* @return string The current version number
|
1496 |
+
*/
|
1497 |
+
public function get_version() {
|
1498 |
+
return $this->version;
|
1499 |
+
}
|
1500 |
}
|
{includes/libraries → vendor/widgitlabs}/simple-settings/license.txt
RENAMED
File without changes
|
{includes/libraries → vendor/widgitlabs}/simple-settings/modules/licensing/class-simple-settings-license.php
RENAMED
File without changes
|
{includes/libraries → vendor/widgitlabs}/simple-settings/modules/licensing/class-simple-settings-plugin-updater.php
RENAMED
@@ -243,7 +243,7 @@ class Simple_Settings_Plugin_Updater {
|
|
243 |
if ( empty( $version_info->download_link ) ) {
|
244 |
printf(
|
245 |
// Translators: The name, link, and version.
|
246 |
-
esc_html__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', '
|
247 |
esc_html( $version_info->name ),
|
248 |
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
249 |
esc_html( $version_info->new_version ),
|
@@ -252,7 +252,7 @@ class Simple_Settings_Plugin_Updater {
|
|
252 |
} else {
|
253 |
printf(
|
254 |
// Translators: The name, link, version, and download link.
|
255 |
-
esc_html__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', '
|
256 |
esc_html( $version_info->name ),
|
257 |
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
258 |
esc_html( $version_info->new_version ),
|
@@ -409,7 +409,7 @@ class Simple_Settings_Plugin_Updater {
|
|
409 |
}
|
410 |
|
411 |
if ( ! current_user_can( 'update_plugins' ) ) {
|
412 |
-
wp_die( esc_html__( 'You do not have permission to install plugin updates', '
|
413 |
}
|
414 |
|
415 |
global $simple_settings_plugin_data;
|
243 |
if ( empty( $version_info->download_link ) ) {
|
244 |
printf(
|
245 |
// Translators: The name, link, and version.
|
246 |
+
esc_html__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s.', 'simple-settings' ),
|
247 |
esc_html( $version_info->name ),
|
248 |
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
249 |
esc_html( $version_info->new_version ),
|
252 |
} else {
|
253 |
printf(
|
254 |
// Translators: The name, link, version, and download link.
|
255 |
+
esc_html__( 'There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s.', 'simple-settings' ),
|
256 |
esc_html( $version_info->name ),
|
257 |
'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
|
258 |
esc_html( $version_info->new_version ),
|
409 |
}
|
410 |
|
411 |
if ( ! current_user_can( 'update_plugins' ) ) {
|
412 |
+
wp_die( esc_html__( 'You do not have permission to install plugin updates', 'simple-settings' ), esc_html__( 'Error', 'simple-settings' ), array( 'response' => 403 ) );
|
413 |
}
|
414 |
|
415 |
global $simple_settings_plugin_data;
|
{includes/libraries → vendor/widgitlabs}/simple-settings/modules/sysinfo/class-browser.php
RENAMED
File without changes
|
{includes/libraries → vendor/widgitlabs}/simple-settings/modules/sysinfo/class-simple-settings-sysinfo.php
RENAMED
File without changes
|