mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
Merge pull request #1396 from ultimatemember/development/2.8.x
Version 2.8.2
This commit is contained in:
@@ -44,7 +44,7 @@ GNU Version 2 or Any Later Version
|
||||
|
||||
### IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
|
||||
|
||||
[Official Release Version: 2.8.1](https://github.com/ultimatemember/ultimatemember/releases/tag/2.8.1).
|
||||
[Official Release Version: 2.8.2](https://github.com/ultimatemember/ultimatemember/releases/tag/2.8.2).
|
||||
|
||||
## Changelog
|
||||
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
float: right; }
|
||||
.um-admin-half p:first-child {
|
||||
margin-top: 0; }
|
||||
.um-admin-half .um {
|
||||
opacity: 1;
|
||||
margin-bottom: 0 !important; }
|
||||
|
||||
.um-admin-tri {
|
||||
float: left;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -91,6 +91,9 @@
|
||||
float: right
|
||||
p:first-child
|
||||
margin-top: 0
|
||||
.um
|
||||
opacity: 1
|
||||
margin-bottom: 0 !important
|
||||
.#{$prefix}admin-tri
|
||||
float: left
|
||||
width: 33%
|
||||
|
||||
@@ -85,3 +85,31 @@ body.um-admin-modal-open {
|
||||
height: 200px; }
|
||||
.um-admin-metabox textarea.um-admin-error {
|
||||
border-color: #c74a4a !important; }
|
||||
|
||||
.um .picker__box,
|
||||
.um .picker__nav--prev:hover,
|
||||
.um .picker__nav--next:hover {
|
||||
background: #0085ba; }
|
||||
|
||||
.um .picker__footer,
|
||||
.um .picker__header,
|
||||
.um .picker__day--infocus:hover,
|
||||
.um .picker__day--outfocus:hover,
|
||||
.um .picker__day--highlighted:hover,
|
||||
.um .picker--focused .picker__day--highlighted,
|
||||
.um .picker__list-item:hover,
|
||||
.um .picker__list-item--highlighted:hover,
|
||||
.um .picker--focused .picker__list-item--highlighted,
|
||||
.um .picker__list-item--selected,
|
||||
.um .picker__list-item--selected:hover,
|
||||
.um .picker--focused .picker__list-item--selected {
|
||||
background: #008ec2; }
|
||||
|
||||
body.um .picker .picker__frame {
|
||||
top: 32px; }
|
||||
|
||||
body.um .picker .picker__footer > button:not(:disabled):not(.button) {
|
||||
color: #fff; }
|
||||
|
||||
body.um .picker .picker__footer > button.picker__button--close {
|
||||
margin-top: 5px; }
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um-adm-ico{font-size:18px;width:18px;text-align:center;display:inline-block;color:#7acf58}.um-adm-ico.inactive{color:#c74a4a}.um-adm-ico.pointer{cursor:pointer}body.um-admin-modal-open{overflow:hidden}.um-admin #major-publishing-actions{background-color:#fff!important;border-top:0}.um-admin a.button i,.um-admin a.button-primary i{font-size:15px!important;height:15px!important;width:15px!important;text-align:center!important;margin:0 5px 0 0!important;display:inline-block}.um-admin a.button i:before,.um-admin a.button-primary i:before{position:relative;top:1px}.um-admin-metabox h6{font-size:14px;margin:12px 0 0 0}.um-admin-metabox h3{padding-left:0!important}.um-admin-metabox h4{font-size:14px;background:#f5f5f5;padding:8px 4px;color:#333}.um-admin-metabox p{margin:10px 0 0 0}.um-admin-metabox label{display:block;cursor:default;padding:0!important;font-size:13px;color:#666}.um-admin-metabox input[type=text]{height:auto!important;width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:4px 10px!important}.um-admin-metabox input[type=text]:disabled{opacity:.7!important;color:#aaa!important}.um-admin-metabox input[type=text].small{width:54px}.um-admin-metabox input[type=text].um-admin-error{border-color:#c74a4a!important}.um-admin-metabox textarea{width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:8px!important;color:#888!important;min-height:100px;height:100px}.um-admin-metabox textarea.tall{min-height:200px;height:200px}.um-admin-metabox textarea.um-admin-error{border-color:#c74a4a!important}
|
||||
.um-adm-ico{font-size:18px;width:18px;text-align:center;display:inline-block;color:#7acf58}.um-adm-ico.inactive{color:#c74a4a}.um-adm-ico.pointer{cursor:pointer}body.um-admin-modal-open{overflow:hidden}.um-admin #major-publishing-actions{background-color:#fff!important;border-top:0}.um-admin a.button i,.um-admin a.button-primary i{font-size:15px!important;height:15px!important;width:15px!important;text-align:center!important;margin:0 5px 0 0!important;display:inline-block}.um-admin a.button i:before,.um-admin a.button-primary i:before{position:relative;top:1px}.um-admin-metabox h6{font-size:14px;margin:12px 0 0 0}.um-admin-metabox h3{padding-left:0!important}.um-admin-metabox h4{font-size:14px;background:#f5f5f5;padding:8px 4px;color:#333}.um-admin-metabox p{margin:10px 0 0 0}.um-admin-metabox label{display:block;cursor:default;padding:0!important;font-size:13px;color:#666}.um-admin-metabox input[type=text]{height:auto!important;width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:4px 10px!important}.um-admin-metabox input[type=text]:disabled{opacity:.7!important;color:#aaa!important}.um-admin-metabox input[type=text].small{width:54px}.um-admin-metabox input[type=text].um-admin-error{border-color:#c74a4a!important}.um-admin-metabox textarea{width:100%;max-width:100%;display:block;box-sizing:border-box!important;font-size:13px!important;line-height:1.4em!important;padding:8px!important;color:#888!important;min-height:100px;height:100px}.um-admin-metabox textarea.tall{min-height:200px;height:200px}.um-admin-metabox textarea.um-admin-error{border-color:#c74a4a!important}.um .picker__box,.um .picker__nav--next:hover,.um .picker__nav--prev:hover{background:#0085ba}.um .picker--focused .picker__day--highlighted,.um .picker--focused .picker__list-item--highlighted,.um .picker--focused .picker__list-item--selected,.um .picker__day--highlighted:hover,.um .picker__day--infocus:hover,.um .picker__day--outfocus:hover,.um .picker__footer,.um .picker__header,.um .picker__list-item--highlighted:hover,.um .picker__list-item--selected,.um .picker__list-item--selected:hover,.um .picker__list-item:hover{background:#008ec2}body.um .picker .picker__frame{top:32px}body.um .picker .picker__footer>button:not(:disabled):not(.button){color:#fff}body.um .picker .picker__footer>button.picker__button--close{margin-top:5px}
|
||||
@@ -85,3 +85,32 @@ body.#{$prefix}admin-modal-open
|
||||
height: 200px
|
||||
&.#{$prefix}admin-error
|
||||
border-color: #{$admin-warning} !important
|
||||
|
||||
.um
|
||||
.picker__box,
|
||||
.picker__nav--prev:hover,
|
||||
.picker__nav--next:hover
|
||||
background: #{$um-base}
|
||||
.picker__footer,
|
||||
.picker__header,
|
||||
.picker__day--infocus:hover,
|
||||
.picker__day--outfocus:hover,
|
||||
.picker__day--highlighted:hover,
|
||||
.picker--focused .picker__day--highlighted,
|
||||
.picker__list-item:hover,
|
||||
.picker__list-item--highlighted:hover,
|
||||
.picker--focused .picker__list-item--highlighted,
|
||||
.picker__list-item--selected,
|
||||
.picker__list-item--selected:hover,
|
||||
.picker--focused .picker__list-item--selected
|
||||
background: #{$um-base-hover}
|
||||
|
||||
body.um
|
||||
.picker
|
||||
.picker__frame
|
||||
top: 32px
|
||||
.picker__footer
|
||||
& > button:not(:disabled):not(.button)
|
||||
color: #fff
|
||||
& > button.picker__button--close
|
||||
margin-top: 5px
|
||||
|
||||
@@ -158,16 +158,16 @@ input[type="number"].um-forms-field {
|
||||
background: #44b0ec;
|
||||
border: 1px solid #44b0ec !important;
|
||||
margin-top: -1px; }
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 select {
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 > select {
|
||||
width: 100%;
|
||||
float: left; }
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input {
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 > input {
|
||||
width: 100%;
|
||||
float: left; }
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input.um-timepicker-filter, .um-md-default-filters-option-line .um-field-wrapper2 input.um-datepicker-filter {
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 > input.um-timepicker-filter, .um-md-default-filters-option-line .um-field-wrapper2 > input.um-datepicker-filter {
|
||||
width: calc( 50% - 7px) !important;
|
||||
float: left; }
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 input.um-timepicker-filter:first-child, .um-md-default-filters-option-line .um-field-wrapper2 input.um-datepicker-filter:first-child {
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 > input.um-timepicker-filter:first-child, .um-md-default-filters-option-line .um-field-wrapper2 > input.um-datepicker-filter:first-child {
|
||||
margin-right: 11px; }
|
||||
.um-md-default-filters-option-line .um-field-wrapper2 .um-slider {
|
||||
margin: 5px 9px 0 9px;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -162,10 +162,10 @@ input[type="number"]
|
||||
background: #44b0ec
|
||||
border: 1px solid #44b0ec !important
|
||||
margin-top: -1px
|
||||
select
|
||||
& > select
|
||||
width: 100%
|
||||
float: left
|
||||
input
|
||||
& > input
|
||||
width: 100%
|
||||
float: left
|
||||
&.#{$prefix}timepicker-filter,
|
||||
|
||||
+12
-6
@@ -1,9 +1,11 @@
|
||||
/* Tipsy customizations */
|
||||
.um .tipsy {
|
||||
.um .tipsy,
|
||||
.um-page .tipsy {
|
||||
z-index: 9999999999;
|
||||
font-size: inherit; }
|
||||
|
||||
.um .tipsy-inner {
|
||||
.um .tipsy-inner,
|
||||
.um-page .tipsy-inner {
|
||||
background-color: #333333;
|
||||
color: #fff;
|
||||
max-width: 250px;
|
||||
@@ -15,14 +17,18 @@
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale; }
|
||||
|
||||
.um .tipsy-arrow-n {
|
||||
.um .tipsy-arrow-n,
|
||||
.um-page .tipsy-arrow-n {
|
||||
border-bottom-color: #333; }
|
||||
|
||||
.um .tipsy-arrow-s {
|
||||
.um .tipsy-arrow-s,
|
||||
.um-page .tipsy-arrow-s {
|
||||
border-top-color: #333; }
|
||||
|
||||
.um .tipsy-arrow-e {
|
||||
.um .tipsy-arrow-e,
|
||||
.um-page .tipsy-arrow-e {
|
||||
border-left-color: #333; }
|
||||
|
||||
.um .tipsy-arrow-w {
|
||||
.um .tipsy-arrow-w,
|
||||
.um-page .tipsy-arrow-w {
|
||||
border-right-color: #333; }
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um .tipsy{z-index:9999999999;font-size:inherit}.um .tipsy-inner{background-color:#333;color:#fff;max-width:250px;padding:6px 10px;text-align:left;font-size:13px;line-height:17px;word-wrap:break-word;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.um .tipsy-arrow-n{border-bottom-color:#333}.um .tipsy-arrow-s{border-top-color:#333}.um .tipsy-arrow-e{border-left-color:#333}.um .tipsy-arrow-w{border-right-color:#333}
|
||||
.um .tipsy,.um-page .tipsy{z-index:9999999999;font-size:inherit}.um .tipsy-inner,.um-page .tipsy-inner{background-color:#333;color:#fff;max-width:250px;padding:6px 10px;text-align:left;font-size:13px;line-height:17px;word-wrap:break-word;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.um .tipsy-arrow-n,.um-page .tipsy-arrow-n{border-bottom-color:#333}.um .tipsy-arrow-s,.um-page .tipsy-arrow-s{border-top-color:#333}.um .tipsy-arrow-e,.um-page .tipsy-arrow-e{border-left-color:#333}.um .tipsy-arrow-w,.um-page .tipsy-arrow-w{border-right-color:#333}
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Tipsy customizations */
|
||||
.um
|
||||
.um,
|
||||
.um-page
|
||||
.tipsy
|
||||
z-index: 9999999999
|
||||
font-size: inherit
|
||||
|
||||
@@ -62,6 +62,15 @@
|
||||
color: #555;
|
||||
}
|
||||
|
||||
div.uimob340 .um-account-main div.um-account-heading.uimob340-hide,
|
||||
div.uimob500 .um-account-main div.um-account-heading.uimob500-hide {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.um-account-side .um-account-link {
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.um-account-main div.um-account-heading i {
|
||||
margin-right: 10px;
|
||||
font-size: 26px;
|
||||
@@ -193,8 +202,9 @@
|
||||
border-right: 1px solid #ccc;
|
||||
color: #444;
|
||||
float: left;
|
||||
padding: 0px 15px;
|
||||
padding: 0 15px;
|
||||
font-weight: normal !important;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.um-account-side li a span.um-account-icon i {
|
||||
@@ -244,4 +254,4 @@
|
||||
background-color: #44b0ec;
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um-account i{vertical-align:baseline!important}.um-account p.um-notice{margin:0 0 20px 0!important;padding:12px 15px!important}.um-account a:focus{outline:0!important}.um-account-side{float:left;width:30%;padding:0;box-sizing:border-box}.um-account-main{float:left;width:70%;padding:0 0 0 1.5em;box-sizing:border-box}.um-account-main a{border-bottom:none!important}.um-account-tab{display:none}.um-account-tab .um-field .um-field-label{display:flex;flex-direction:row;align-items:baseline;flex-wrap:nowrap;justify-content:flex-start}.um-account-main div.um-account-heading{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:flex-start;align-items:baseline;margin:0!important;font-size:18px;line-height:18px;font-weight:700;color:#555}.um-account-main div.um-account-heading i{margin-right:10px;font-size:26px;position:relative;top:2px}.um-account-main p{margin:20px 0 0 0!important;padding:0!important}.um-account-main label{font-size:15px}.um-account-meta{text-align:center;margin-bottom:20px}.um-account-meta img{margin:0!important;position:static!important;float:none!important;display:inline-block}.um-account-meta.radius-1 img{-moz-border-radius:999px;-webkit-border-radius:999px;border-radius:999px}.um-account-meta.radius-2 img{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.um-account-meta.radius-3 img{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.um-account-name{padding-top:12px}.um-account-name a{font-weight:700;color:#555;text-decoration:none!important;font-size:18px;line-height:1.4em}.um-account-profile-link a{font-size:13px;font-weight:400}.um-account-nav a{display:block;height:44px;line-height:44px;color:#666!important;text-decoration:none!important;position:relative;padding-left:40px;border-bottom:1px solid #eee!important;transition:all .2s linear;font-size:14px}.um-account-nav a.current{font-weight:700}.um-account-nav span.arr{position:absolute;right:0;top:1px;font-size:28px}.um-account-nav span.ico{position:absolute;left:0;top:0;font-size:21px;width:21px;text-align:center}.um-account-side li,.um-account-side ul{margin:0!important;padding:0!important;list-style-type:none!important}.um-account-side li{margin-bottom:1px!important;background:#eee}.um-account-side li a{display:block;padding:4px 0;font-size:14px;height:30px;line-height:20px;color:#999;position:relative}.um-account-side li a span.um-account-arrow{position:absolute;right:10px;top:6px;font-size:26px;opacity:.6}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{text-align:center;font-size:20px;width:20px;height:30px;border-right:1px solid #ccc;color:#444;float:left;padding:0 15px;font-weight:400!important}.um-account-side li a span.um-account-icon i{display:block;height:30px;line-height:30px}.um-account-side li a span.um-account-title{padding-left:20px;float:left;height:30px;line-height:30px;color:#555}.um-account-side li a:hover{color:#444;background:#ddd}.um-account-side li a.current,.um-account-side li a.current:hover{color:#444;font-weight:700;text-decoration:none!important}.um-field-export_data .um-field-error{display:none}.um-field-export_data .um-field-area-response{display:none;line-height:1.5;padding:10px 0}.um-request-button{display:inline-block;background-color:#3ba1da;border-radius:5px;color:#fff;margin:10px 0 0;padding:5px 10px;text-decoration:none}.um-request-button:hover{background-color:#44b0ec;color:#fff;text-decoration:none}
|
||||
.um-account i{vertical-align:baseline!important}.um-account p.um-notice{margin:0 0 20px 0!important;padding:12px 15px!important}.um-account a:focus{outline:0!important}.um-account-side{float:left;width:30%;padding:0;box-sizing:border-box}.um-account-main{float:left;width:70%;padding:0 0 0 1.5em;box-sizing:border-box}.um-account-main a{border-bottom:none!important}.um-account-tab{display:none}.um-account-tab .um-field .um-field-label{display:flex;flex-direction:row;align-items:baseline;flex-wrap:nowrap;justify-content:flex-start}.um-account-main div.um-account-heading{display:flex;flex-wrap:nowrap;flex-direction:row;justify-content:flex-start;align-items:baseline;margin:0!important;font-size:18px;line-height:18px;font-weight:700;color:#555}div.uimob340 .um-account-main div.um-account-heading.uimob340-hide,div.uimob500 .um-account-main div.um-account-heading.uimob500-hide{display:none}.um-account-side .um-account-link{box-sizing:content-box}.um-account-main div.um-account-heading i{margin-right:10px;font-size:26px;position:relative;top:2px}.um-account-main p{margin:20px 0 0 0!important;padding:0!important}.um-account-main label{font-size:15px}.um-account-meta{text-align:center;margin-bottom:20px}.um-account-meta img{margin:0!important;position:static!important;float:none!important;display:inline-block}.um-account-meta.radius-1 img{-moz-border-radius:999px;-webkit-border-radius:999px;border-radius:999px}.um-account-meta.radius-2 img{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px}.um-account-meta.radius-3 img{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.um-account-name{padding-top:12px}.um-account-name a{font-weight:700;color:#555;text-decoration:none!important;font-size:18px;line-height:1.4em}.um-account-profile-link a{font-size:13px;font-weight:400}.um-account-nav a{display:block;height:44px;line-height:44px;color:#666!important;text-decoration:none!important;position:relative;padding-left:40px;border-bottom:1px solid #eee!important;transition:all .2s linear;font-size:14px}.um-account-nav a.current{font-weight:700}.um-account-nav span.arr{position:absolute;right:0;top:1px;font-size:28px}.um-account-nav span.ico{position:absolute;left:0;top:0;font-size:21px;width:21px;text-align:center}.um-account-side li,.um-account-side ul{margin:0!important;padding:0!important;list-style-type:none!important}.um-account-side li{margin-bottom:1px!important;background:#eee}.um-account-side li a{display:block;padding:4px 0;font-size:14px;height:30px;line-height:20px;color:#999;position:relative}.um-account-side li a span.um-account-arrow{position:absolute;right:10px;top:6px;font-size:26px;opacity:.6}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{text-align:center;font-size:20px;width:20px;height:30px;border-right:1px solid #ccc;color:#444;float:left;padding:0 15px;font-weight:400!important;box-sizing:content-box}.um-account-side li a span.um-account-icon i{display:block;height:30px;line-height:30px}.um-account-side li a span.um-account-title{padding-left:20px;float:left;height:30px;line-height:30px;color:#555}.um-account-side li a:hover{color:#444;background:#ddd}.um-account-side li a.current,.um-account-side li a.current:hover{color:#444;font-weight:700;text-decoration:none!important}.um-field-export_data .um-field-error{display:none}.um-field-export_data .um-field-area-response{display:none;line-height:1.5;padding:10px 0}.um-request-button{display:inline-block;background-color:#3ba1da;border-radius:5px;color:#fff;margin:10px 0 0;padding:5px 10px;text-decoration:none}.um-request-button:hover{background-color:#44b0ec;color:#fff;text-decoration:none}
|
||||
@@ -1,8 +1,12 @@
|
||||
.um {
|
||||
.rtl .um {
|
||||
direction: rtl !important;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.rtl .um:not(.um-admin) {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.um-profile-photo {
|
||||
float: right;
|
||||
margin: 0 30px 0 0;
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um{direction:rtl!important;text-align:right}.um-profile-photo{float:right;margin:0 30px 0 0}.um-profile-photo a.um-profile-photo-img{float:right;left:auto}.um-cover+.um-header .um-profile-photo a.um-profile-photo-img{right:0}div.uimob500 .um-profile-photo a.um-profile-photo-img{right:auto}.um-profile-edit{right:auto;left:0;margin-left:10px;margin-right:0}div.uimob800 .um-header .um-profile-meta,div.uimob960 .um-header .um-profile-meta{padding-left:0!important;padding-right:200px!important}.um-name{float:right;margin-right:0}.um-profile-nav-item a{float:right;padding:6px 28px 6px 10px}.um-profile-nav-item i{left:auto;right:6px}.um-profile-nav-item a{float:right}.um-field-checkbox-state,.um-field-radio-state{right:1px;left:auto}.um-field-checkbox-option,.um-field-radio-option{margin:0 36px 0 0}.um-field-half{float:right}.um-field-half.right{float:left}.um-left{float:right}.um-right{float:left}.um-account-main,.um-account-side{float:right}.um-account-main div.um-account-heading i{margin-right:0;margin-left:10px}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{float:right;border-left:1px solid #ccc}.um-account-side li a span.um-account-title{padding-right:20px;float:right}.um-account-side li a span.um-account-arrow{right:auto;left:10px}.um-field-label .um-field-label-icon{float:right;margin:0 0 0 8px}p.um-notice i{right:auto;left:14px}.um-account.uimob340 .um-account-nav a,.um-account.uimob500 .um-account-nav a{padding-left:0;padding-right:40px}.um-account.uimob340 .um-account-nav span.ico,.um-account.uimob500 .um-account-nav span.ico{right:0}.um-account.uimob340 .um-account-nav span.arr,.um-account.uimob500 .um-account-nav span.arr{right:auto;left:0}.select2.select2-container .select2-selection .select2-selection__arrow{right:auto!important}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;text-align:right;padding-left:20px}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{margin-left:4px}.um-single-file-preview a.cancel,.um-single-image-preview a.cancel{left:-15px;right:auto}.select2.select2-container .select2-selection{padding:0 12px 0 0!important}.select2-selection__clear{right:auto;left:1px}.cropper-container{margin:0 auto;left:auto!important}.um-field-label .um-tip{margin:0 8px 0 0}.tipsy-inner{text-align:right!important}.um span.um-req{margin:0 8px 0 0}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{border-right:none}.um-field-error .um-field-arrow{left:0;right:10px}.um-single-file-preview a.cancel,.um-single-image-preview a.cancel{left:0}.um-modal-body .um-single-file-preview a.cancel,.um-modal-body .um-single-image-preview a.cancel{left:-15px}.um-item-link{padding-right:0;padding-left:40px}
|
||||
.rtl .um{direction:rtl!important;text-align:right}.rtl .um:not(.um-admin){text-align:right}.um-profile-photo{float:right;margin:0 30px 0 0}.um-profile-photo a.um-profile-photo-img{float:right;left:auto}.um-cover+.um-header .um-profile-photo a.um-profile-photo-img{right:0}div.uimob500 .um-profile-photo a.um-profile-photo-img{right:auto}.um-profile-edit{right:auto;left:0;margin-left:10px;margin-right:0}div.uimob800 .um-header .um-profile-meta,div.uimob960 .um-header .um-profile-meta{padding-left:0!important;padding-right:200px!important}.um-name{float:right;margin-right:0}.um-profile-nav-item a{float:right;padding:6px 28px 6px 10px}.um-profile-nav-item i{left:auto;right:6px}.um-profile-nav-item a{float:right}.um-field-checkbox-state,.um-field-radio-state{right:1px;left:auto}.um-field-checkbox-option,.um-field-radio-option{margin:0 36px 0 0}.um-field-half{float:right}.um-field-half.right{float:left}.um-left{float:right}.um-right{float:left}.um-account-main,.um-account-side{float:right}.um-account-main div.um-account-heading i{margin-right:0;margin-left:10px}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{float:right;border-left:1px solid #ccc}.um-account-side li a span.um-account-title{padding-right:20px;float:right}.um-account-side li a span.um-account-arrow{right:auto;left:10px}.um-field-label .um-field-label-icon{float:right;margin:0 0 0 8px}p.um-notice i{right:auto;left:14px}.um-account.uimob340 .um-account-nav a,.um-account.uimob500 .um-account-nav a{padding-left:0;padding-right:40px}.um-account.uimob340 .um-account-nav span.ico,.um-account.uimob500 .um-account-nav span.ico{right:0}.um-account.uimob340 .um-account-nav span.arr,.um-account.uimob500 .um-account-nav span.arr{right:auto;left:0}.select2.select2-container .select2-selection .select2-selection__arrow{right:auto!important}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;text-align:right;padding-left:20px}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{margin-left:4px}.um-single-file-preview a.cancel,.um-single-image-preview a.cancel{left:-15px;right:auto}.select2.select2-container .select2-selection{padding:0 12px 0 0!important}.select2-selection__clear{right:auto;left:1px}.cropper-container{margin:0 auto;left:auto!important}.um-field-label .um-tip{margin:0 8px 0 0}.tipsy-inner{text-align:right!important}.um span.um-req{margin:0 8px 0 0}.um-account-side li a span.um-account-icon,.um-account-side li a.current span.um-account-icon,.um-account-side li a.current:hover span.um-account-icon{border-right:none}.um-field-error .um-field-arrow{left:0;right:10px}.um-single-file-preview a.cancel,.um-single-image-preview a.cancel{left:0}.um-modal-body .um-single-file-preview a.cancel,.um-modal-body .um-single-image-preview a.cancel{left:-15px}.um-item-link{padding-right:0;padding-left:40px}
|
||||
@@ -442,6 +442,7 @@ jQuery(document).ready( function() {
|
||||
hiddenName: true,
|
||||
onOpen: function() {
|
||||
elem.blur();
|
||||
elem.siblings('.picker').find('.picker__button--close').addClass('button');
|
||||
},
|
||||
onClose: function() {
|
||||
elem.blur();
|
||||
@@ -550,6 +551,7 @@ jQuery(document).ready( function() {
|
||||
hiddenName: true,
|
||||
onOpen: function() {
|
||||
elem.blur();
|
||||
elem.siblings('.picker').find('.picker__button--close').addClass('button');
|
||||
},
|
||||
onClose: function() {
|
||||
elem.blur();
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -91,7 +91,7 @@ UM.frontend = {
|
||||
}
|
||||
},
|
||||
destroy: function() {
|
||||
if ( jQuery('.cropper-container').length > 0 ) {
|
||||
if ( jQuery('.cropper-container').length > 0 && UM.frontend.cropper.obj ) {
|
||||
UM.frontend.cropper.obj.destroy(); // destroy Cropper.JS method
|
||||
UM.frontend.cropper.obj = null; // flush our own object
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.frontend&&(UM.frontend={}),UM.frontend={cropper:{obj:null,init:function(){var o=jQuery(".um-modal .um-single-image-preview img").first();if(o.length&&""!==o.attr("src")){UM.frontend.cropper.obj&&UM.frontend.cropper.destroy();var t=jQuery(".um-modal .um-single-image-preview"),r=o.parent().data("crop"),n=o.parent().data("min_width"),i=o.parent().data("min_height"),a=o.parent().data("ratio"),d=jQuery(".um-modal").find("#um_upload_single").data("ratio"),d=(d&&(a=d.split(":")[0]),jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height());o.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),o.css({height:"auto"})):(o.css({height:"auto","max-height":d+"px"}),t.css({height:o.height(),"max-height":d+"px"}));let e;"square"===r?e={minWidth:n,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1}:"cover"===r?(0<Math.round(n/a)&&(i=Math.round(n/a)),e={minWidth:n,minHeight:i,dragCrop:!1,aspectRatio:a,zoomable:!1,rotatable:!1,dashed:!1}):"user"===r&&(e={minWidth:n,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1}),e&&(UM.frontend.cropper.obj=new Cropper(o[0],e))}},destroy:function(){0<jQuery(".cropper-container").length&&(UM.frontend.cropper.obj.destroy(),UM.frontend.cropper.obj=null)}}},wp.hooks.addAction("um_remove_modal","um_common_frontend",function(){UM.frontend.cropper.destroy()}),wp.hooks.addAction("um_after_removing_preview","um_common_frontend",function(){UM.frontend.cropper.destroy()}),wp.hooks.addAction("um_window_resize","um_common_frontend",function(){UM.frontend.cropper.destroy()});
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.frontend&&(UM.frontend={}),UM.frontend={cropper:{obj:null,init:function(){var o=jQuery(".um-modal .um-single-image-preview img").first();if(o.length&&""!==o.attr("src")){UM.frontend.cropper.obj&&UM.frontend.cropper.destroy();var t=jQuery(".um-modal .um-single-image-preview"),r=o.parent().data("crop"),n=o.parent().data("min_width"),i=o.parent().data("min_height"),a=o.parent().data("ratio"),d=jQuery(".um-modal").find("#um_upload_single").data("ratio"),d=(d&&(a=d.split(":")[0]),jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height());o.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:d+"px","max-height":d+"px"}),o.css({height:"auto"})):(o.css({height:"auto","max-height":d+"px"}),t.css({height:o.height(),"max-height":d+"px"}));let e;"square"===r?e={minWidth:n,minHeight:i,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1}:"cover"===r?(0<Math.round(n/a)&&(i=Math.round(n/a)),e={minWidth:n,minHeight:i,dragCrop:!1,aspectRatio:a,zoomable:!1,rotatable:!1,dashed:!1}):"user"===r&&(e={minWidth:n,minHeight:i,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1}),e&&(UM.frontend.cropper.obj=new Cropper(o[0],e))}},destroy:function(){0<jQuery(".cropper-container").length&&UM.frontend.cropper.obj&&(UM.frontend.cropper.obj.destroy(),UM.frontend.cropper.obj=null)}}},wp.hooks.addAction("um_remove_modal","um_common_frontend",function(){UM.frontend.cropper.destroy()}),wp.hooks.addAction("um_after_removing_preview","um_common_frontend",function(){UM.frontend.cropper.destroy()}),wp.hooks.addAction("um_window_resize","um_common_frontend",function(){UM.frontend.cropper.destroy()});
|
||||
+6
-22
@@ -73,7 +73,12 @@ UM.common = {
|
||||
format: elem.attr( 'data-format' ),
|
||||
formatSubmit: 'yyyy/mm/dd',
|
||||
hiddenName: true,
|
||||
onOpen: function() { elem.blur(); },
|
||||
onOpen: function() {
|
||||
elem.blur();
|
||||
if ( elem.parents('body').hasClass('wp-admin') ) {
|
||||
elem.siblings('.picker').find('.picker__button--close').addClass('button')
|
||||
}
|
||||
},
|
||||
onClose: function() { elem.blur(); }
|
||||
};
|
||||
|
||||
@@ -116,27 +121,6 @@ UM.common = {
|
||||
}
|
||||
}
|
||||
|
||||
jQuery.ajaxSetup({
|
||||
beforeSend: function( jqXHR, settings ) {
|
||||
if ( settings.processData ) {
|
||||
if ( settings.data !== '' ) {
|
||||
settings.data += '&um_current_locale=' + um_common_variables.locale;
|
||||
} else {
|
||||
settings.data = 'um_current_locale=' + um_common_variables.locale;
|
||||
}
|
||||
} else {
|
||||
settings.data = jQuery.extend(
|
||||
settings.data,
|
||||
{
|
||||
um_current_locale: um_common_variables.locale
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(document).on( 'ajaxStart', function() {
|
||||
UM.common.tipsy.hide();
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.common&&(UM.common={}),UM.common={tipsy:{init:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))},hide:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy("hide"),jQuery(".um-tip-w").tipsy("hide"),jQuery(".um-tip-e").tipsy("hide"),jQuery(".um-tip-s").tipsy("hide"),jQuery(".um .tipsy").remove())}},datetimePicker:{init:function(){jQuery(".um-datepicker:not(.picker__input)").each(function(){e=void 0!==(elem=jQuery(this)).attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays")&&JSON.parse(elem.attr("data-disabled_weekdays"));var e,t=null,a=(void 0!==elem.attr("data-years")&&(t=elem.attr("data-years")),elem.attr("data-date_min")),i=elem.attr("data-date_max"),n=[],o=[],a=(void 0!==a&&(n=a.split(",")),void 0!==i&&(o=i.split(",")),n.length?new Date(n):null),i=n.length?new Date(o):null,o=(a&&"Invalid Date"==a.toString()&&3==n.length&&(n=n[1]+"/"+n[2]+"/"+n[0],a=new Date(Date.parse(n))),i&&"Invalid Date"==i.toString()&&3==o.length&&(n=o[1]+"/"+o[2]+"/"+o[0],i=new Date(Date.parse(n))),{disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}});null!==t&&(o.selectYears=t),null!==a&&(o.min=a),null!==i&&(o.max=i),elem.pickadate(o)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){(elem=jQuery(this)).pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}},select:{isSelected:function(e,t){return e===t?' selected="selected"':""}}},jQuery.ajaxSetup({beforeSend:function(e,t){return t.processData?""!==t.data?t.data+="&um_current_locale="+um_common_variables.locale:t.data="um_current_locale="+um_common_variables.locale:t.data=jQuery.extend(t.data,{um_current_locale:um_common_variables.locale}),!0}}),jQuery(document).on("ajaxStart",function(){UM.common.tipsy.hide()}),jQuery(document).on("ajaxSuccess",function(){UM.common.tipsy.init()}),jQuery(document).ready(function(){UM.common.tipsy.init(),UM.common.datetimePicker.init()});
|
||||
"object"!=typeof window.UM&&(window.UM={}),"object"!=typeof UM.common&&(UM.common={}),UM.common={tipsy:{init:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}))},hide:function(){"function"==typeof jQuery.fn.tipsy&&(jQuery(".um-tip-n").tipsy("hide"),jQuery(".um-tip-w").tipsy("hide"),jQuery(".um-tip-e").tipsy("hide"),jQuery(".um-tip-s").tipsy("hide"),jQuery(".um .tipsy").remove())}},datetimePicker:{init:function(){jQuery(".um-datepicker:not(.picker__input)").each(function(){e=void 0!==(elem=jQuery(this)).attr("data-disabled_weekdays")&&""!=elem.attr("data-disabled_weekdays")&&JSON.parse(elem.attr("data-disabled_weekdays"));var e,t=null,i=(void 0!==elem.attr("data-years")&&(t=elem.attr("data-years")),elem.attr("data-date_min")),a=elem.attr("data-date_max"),n=[],o=[],i=(void 0!==i&&(n=i.split(",")),void 0!==a&&(o=a.split(",")),n.length?new Date(n):null),a=n.length?new Date(o):null,o=(i&&"Invalid Date"==i.toString()&&3==n.length&&(n=n[1]+"/"+n[2]+"/"+n[0],i=new Date(Date.parse(n))),a&&"Invalid Date"==a.toString()&&3==o.length&&(n=o[1]+"/"+o[2]+"/"+o[0],a=new Date(Date.parse(n))),{disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur(),elem.parents("body").hasClass("wp-admin")&&elem.siblings(".picker").find(".picker__button--close").addClass("button")},onClose:function(){elem.blur()}});null!==t&&(o.selectYears=t),null!==i&&(o.min=i),null!==a&&(o.max=a),elem.pickadate(o)}),jQuery(".um-timepicker:not(.picker__input)").each(function(){(elem=jQuery(this)).pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})})}},select:{isSelected:function(e,t){return e===t?' selected="selected"':""}}},jQuery(document).on("ajaxStart",function(){UM.common.tipsy.hide()}),jQuery(document).on("ajaxSuccess",function(){UM.common.tipsy.init()}),jQuery(document).ready(function(){UM.common.tipsy.init(),UM.common.datetimePicker.init()});
|
||||
@@ -383,9 +383,12 @@ function um_build_template( directory, data ) {
|
||||
|
||||
directory.addClass('um-loaded');
|
||||
|
||||
if (directory.find('.um-members.um-members-grid').length) {
|
||||
UM_Member_Grid(directory.find('.um-members.um-members-grid'));
|
||||
}
|
||||
// It's made via hook because resize is triggered with debounce delay.
|
||||
wp.hooks.addAction( 'um_window_resize', 'um_members', function() {
|
||||
if (directory.find('.um-members.um-members-grid').length) {
|
||||
UM_Member_Grid(directory.find('.um-members.um-members-grid'));
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(document).trigger('um_build_template', [directory, data]);
|
||||
jQuery(window).trigger('resize');
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -3,14 +3,17 @@ jQuery( window ).on( 'load',function() {
|
||||
um_modal_responsive();
|
||||
});
|
||||
|
||||
jQuery(window).on( 'resize', function() {
|
||||
// Resize using debounce.
|
||||
// * https://medium.com/geekculture/debounce-handle-browser-resize-like-a-pro-994cd522e14b
|
||||
// * https://davidwalsh.name/javascript-debounce-function
|
||||
jQuery(window).on( 'resize', _.debounce( function() {
|
||||
responsive_Modal();
|
||||
|
||||
wp.hooks.doAction( 'um_window_resize' );
|
||||
|
||||
um_responsive();
|
||||
um_modal_responsive();
|
||||
});
|
||||
}, 300 ) );
|
||||
|
||||
wp.hooks.addAction( 'um_admin_modal_success_result', 'um_frontend_responsive', function( $adminModal ) {
|
||||
// Make responsive script only when live preview,
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()}),wp.hooks.addAction("um_admin_modal_success_result","um_frontend_responsive",function(o){o.find(".um-admin-modal-body").find(".um").length&&um_responsive()});
|
||||
jQuery(window).on("load",function(){um_responsive(),um_modal_responsive()}),jQuery(window).on("resize",_.debounce(function(){responsive_Modal(),wp.hooks.doAction("um_window_resize"),um_responsive(),um_modal_responsive()},300)),wp.hooks.addAction("um_admin_modal_success_result","um_frontend_responsive",function(o){o.find(".um-admin-modal-body").find(".um").length&&um_responsive()});
|
||||
@@ -466,7 +466,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
array(
|
||||
'id' => '_um_access_hide_from_queries',
|
||||
'type' => 'checkbox',
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ),
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display a 404 page for users who do not have access to this term on the term\'s archive page and terms\' posts single pages?', 'ultimate-member' ),
|
||||
'description' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'value' => 1,
|
||||
'conditional' => array( '_um_accessible', '!=', '0' ),
|
||||
@@ -618,7 +618,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
array(
|
||||
'id' => '_um_access_hide_from_queries',
|
||||
'type' => 'checkbox',
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 error on the term\'s archive page and terms\' posts single pages when users haven\'t access?', 'ultimate-member' ),
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display a 404 page for users who do not have access to this term on the term\'s archive page and terms\' posts single pages?', 'ultimate-member' ),
|
||||
'description' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted term\'s archive page and all terms\' posts will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '',
|
||||
'conditional' => array( '_um_accessible', '!=', '0' ),
|
||||
@@ -1267,7 +1267,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
|
||||
}
|
||||
|
||||
// Set post meta for legacy support in the future.
|
||||
add_post_meta( $post_id, 'um_form_version', UM_VERSION );
|
||||
add_post_meta( $post_id, 'um_form_version', UM_VERSION, true );
|
||||
|
||||
if ( empty( $_POST['post_title'] ) ) {
|
||||
$where = array( 'ID' => $post_id );
|
||||
|
||||
@@ -22,7 +22,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
/**
|
||||
* Admin_Navmenu constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
self::$fields = array(
|
||||
'um_nav_public' => __( 'Display Mode', 'ultimate-member' ),
|
||||
'um_nav_roles' => __( 'By Role', 'ultimate-member' ),
|
||||
@@ -32,6 +32,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
add_action( 'wp_update_nav_menu_item', array( &$this, '_save' ), 10, 3 );
|
||||
|
||||
add_action( 'wp_nav_menu_item_custom_fields', array( $this, 'wp_nav_menu_item_custom_fields' ), 20, 5 );
|
||||
// @todo Appearance > Customize > Menus section without UM settings
|
||||
// add_action( 'wp_nav_menu_item_custom_fields_customize_template', array( $this, 'wp_nav_menu_item_custom_fields_customize_template' ), 20, 5 );
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +49,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
*/
|
||||
public function wp_nav_menu_item_custom_fields( $item_id, $item, $depth, $args, $id = null ) {
|
||||
|
||||
$um_nav_public = get_post_meta( $item->ID, 'menu-item-um_nav_public', true );
|
||||
$um_nav_public = get_post_meta( $item->ID, 'menu-item-um_nav_public', true );
|
||||
$_nav_roles_meta = get_post_meta( $item->ID, 'menu-item-um_nav_roles', true );
|
||||
$um_nav_roles = array();
|
||||
$um_nav_roles = array();
|
||||
if ( $_nav_roles_meta ) {
|
||||
foreach ( $_nav_roles_meta as $key => $value ) {
|
||||
if ( is_int( $key ) ) {
|
||||
@@ -61,48 +63,74 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
?>
|
||||
<div class="um-nav-edit">
|
||||
<div class="clear"></div>
|
||||
<h4 style="margin-bottom: 0.6em;"><?php _e( 'Ultimate Member Menu Settings', 'ultimate-member' ) ?></h4>
|
||||
<h4 style="margin-bottom: 0.6em;"><?php esc_html_e( 'Ultimate Member Menu Settings', 'ultimate-member' ); ?></h4>
|
||||
|
||||
<p class="description description-wide um-nav-mode">
|
||||
<label for="edit-menu-item-um_nav_public-<?php echo esc_attr( $item_id ); ?>">
|
||||
<?php _e( "Who can see this menu link?", 'ultimate-member' ); ?><br/>
|
||||
<?php esc_html_e( 'Who can see this menu link?', 'ultimate-member' ); ?><br/>
|
||||
<select id="edit-menu-item-um_nav_public-<?php echo esc_attr( $item_id ); ?>" name="menu-item-um_nav_public[<?php echo esc_attr( $item_id ); ?>]" style="width:100%;">
|
||||
<option value="0" <?php selected( $um_nav_public, 0 ); ?>><?php _e( 'Everyone', 'ultimate-member' ) ?></option>
|
||||
<option value="1" <?php selected( $um_nav_public, 1 ); ?>><?php _e( 'Logged Out Users', 'ultimate-member' ) ?></option>
|
||||
<option value="2" <?php selected( $um_nav_public, 2 ); ?>><?php _e( 'Logged In Users', 'ultimate-member' ) ?></option>
|
||||
<option value="0" <?php selected( $um_nav_public, 0 ); ?>><?php esc_html_e( 'Everyone', 'ultimate-member' ); ?></option>
|
||||
<option value="1" <?php selected( $um_nav_public, 1 ); ?>><?php esc_html_e( 'Logged Out Users', 'ultimate-member' ); ?></option>
|
||||
<option value="2" <?php selected( $um_nav_public, 2 ); ?>><?php esc_html_e( 'Logged In Users', 'ultimate-member' ); ?></option>
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<p class="description description-wide um-nav-roles" <?php echo $um_nav_public == 2 ? 'style="display: block;"' : ''; ?>><?php _e( "Select the member roles that can see this link", 'ultimate-member' ) ?><br>
|
||||
<p class="description description-wide um-nav-roles" <?php echo 2 === absint( $um_nav_public ) ? 'style="display: block;"' : ''; ?>><?php esc_html_e( 'Select the member roles that can see this link', 'ultimate-member' ); ?><br>
|
||||
|
||||
<?php
|
||||
$i = 0;
|
||||
$html = '';
|
||||
$columns = apply_filters( 'wp_nav_menu_item:um_nav_columns', 2, $item_id, $item );
|
||||
$i = 0;
|
||||
$html = '';
|
||||
$columns = apply_filters( 'wp_nav_menu_item:um_nav_columns', 2, $item_id, $item );
|
||||
$per_page = ceil( count( $options ) / $columns );
|
||||
while ( $i < $columns ) {
|
||||
$section_fields_per_page = array_slice( $options, $i * $per_page, $per_page );
|
||||
|
||||
$html .= '<span class="um-form-fields-section" style="width:' . floor( 100 / $columns ) . '% !important;">';
|
||||
|
||||
foreach ( $section_fields_per_page as $k => $title ) {
|
||||
$id_attr = ' id="edit-menu-item-um_nav_roles-' . $item_id . '_' . $k . '" ';
|
||||
$for_attr = ' for="edit-menu-item-um_nav_roles-' . $item_id . '_' . $k . '" ';
|
||||
$checked_attr = checked( in_array($k,$um_nav_roles), true, false );
|
||||
$html .= "<label {$for_attr}> <input type='checkbox' {$id_attr} name='menu-item-um_nav_roles[{$item_id}][{$k}]' value='1' {$checked_attr} /> <span>{$title}</span> </label>";
|
||||
$id_attr = ' id="edit-menu-item-um_nav_roles-' . $item_id . '_' . $k . '" ';
|
||||
$for_attr = ' for="edit-menu-item-um_nav_roles-' . $item_id . '_' . $k . '" ';
|
||||
$checked_attr = checked( in_array( $k, $um_nav_roles, true ), true, false );
|
||||
$html .= "<label {$for_attr}> <input type='checkbox' {$id_attr} name='menu-item-um_nav_roles[{$item_id}][{$k}]' value='1' {$checked_attr} /> <span>{$title}</span> </label>";
|
||||
}
|
||||
|
||||
$html .= '</span>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo $html;
|
||||
?>
|
||||
</p>
|
||||
<?php do_action( 'um_wp_nav_menu_custom_fields', $item_id, $um_nav_public ); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Appearance > Customize > Menus section without UM settings
|
||||
* @return void
|
||||
*/
|
||||
public function wp_nav_menu_item_custom_fields_customize_template() {
|
||||
?>
|
||||
<div class="clear"></div>
|
||||
|
||||
<h4 style="margin-bottom: 0.6em;"><?php esc_html_e( 'Ultimate Member Menu Settings', 'ultimate-member' ); ?></h4>
|
||||
|
||||
<p class="description description-wide um-nav-mode">
|
||||
<label for="edit-menu-item-um_nav_public-{{ data.menu_item_id }}">
|
||||
<?php esc_html_e( 'Who can see this menu link?', 'ultimate-member' ); ?><br/>
|
||||
<select id="edit-menu-item-um_nav_public-{{ data.menu_item_id }}"
|
||||
name="menu-item-um_nav_public[{{ data.menu_item_id }}]" style="width:100%;">
|
||||
<option value="0"><?php esc_html_e( 'Everyone', 'ultimate-member' ); ?></option>
|
||||
<option value="1"><?php esc_html_e( 'Logged Out Users', 'ultimate-member' ); ?></option>
|
||||
<option value="2"><?php esc_html_e( 'Logged In Users', 'ultimate-member' ); ?></option>
|
||||
</select>
|
||||
</label>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -112,11 +140,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* @param int $menu_id
|
||||
* @param int $menu_item_db_id
|
||||
* @param int $menu_id
|
||||
* @param int $menu_item_db_id
|
||||
* @param array $menu_item_args
|
||||
*/
|
||||
function _save( $menu_id, $menu_item_db_id, $menu_item_args ) {
|
||||
public function _save( $menu_id, $menu_item_db_id, $menu_item_args ) {
|
||||
// phpcs:disable WordPress.Security.NonceVerification
|
||||
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
||||
return;
|
||||
}
|
||||
@@ -125,6 +154,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$fields = apply_filters( 'um_wp_nav_menu_fields', self::$fields );
|
||||
|
||||
foreach ( self::$fields as $_key => $label ) {
|
||||
|
||||
$key = sprintf( 'menu-item-%s', $_key );
|
||||
@@ -132,11 +163,15 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
// Sanitize
|
||||
if ( ! empty( $_POST[ $key ][ $menu_item_db_id ] ) ) {
|
||||
// Do some checks here...
|
||||
$value = is_array( $_POST[ $key ][ $menu_item_db_id ] ) ?
|
||||
array_map( 'sanitize_key', array_keys( $_POST[ $key ][ $menu_item_db_id ] ) ) : (int) $_POST[ $key ][ $menu_item_db_id ];
|
||||
if ( is_array( $_POST[ $key ][ $menu_item_db_id ] ) ) {
|
||||
$value = array_map( 'sanitize_key', array_keys( $_POST[ $key ][ $menu_item_db_id ] ) );
|
||||
} else {
|
||||
$value = (int) $_POST[ $key ][ $menu_item_db_id ];
|
||||
}
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification
|
||||
|
||||
// Update
|
||||
if ( ! is_null( $value ) ) {
|
||||
@@ -148,7 +183,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Navmenu' ) ) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo Deprecate
|
||||
*/
|
||||
function _wp_template() {
|
||||
?>
|
||||
|
||||
@@ -3731,19 +3731,18 @@ Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ?
|
||||
return $section;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function save_email_templates( $settings ) {
|
||||
public function save_email_templates( $settings ) {
|
||||
if ( empty( $settings['um_email_template'] ) ) {
|
||||
return $settings;
|
||||
}
|
||||
|
||||
$template = $settings['um_email_template'];
|
||||
$content = wp_kses_post( stripslashes( $settings[ $template ] ) );
|
||||
$content = wp_kses( stripslashes( $settings[ $template ] ), 'post', array( 'data' ) );
|
||||
|
||||
$theme_template_path = UM()->mail()->get_template_file( 'theme', $template );
|
||||
if ( ! file_exists( $theme_template_path ) ) {
|
||||
@@ -3751,7 +3750,7 @@ Use Only Cookies: <?php echo ini_get( 'session.use_only_cookies' ) ?
|
||||
}
|
||||
|
||||
if ( file_exists( $theme_template_path ) ) {
|
||||
$fp = fopen( $theme_template_path, "w" );
|
||||
$fp = fopen( $theme_template_path, "w" );
|
||||
$result = fputs( $fp, $content );
|
||||
fclose( $fp );
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
array(
|
||||
'id' => '_um_access_hide_from_queries',
|
||||
'type' => 'checkbox',
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display 404 page when users haven\'t access?', 'ultimate-member' ),
|
||||
'label' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Hide from queries', 'ultimate-member' ) : __( 'Would you like to display a 404 page for users who do not have access to this page?', 'ultimate-member' ),
|
||||
'tooltip' => UM()->options()->get( 'disable_restriction_pre_queries' ) ? __( 'Exclude only from WP queries results', 'ultimate-member' ) : __( 'Recommended to be enabled. Restricted post will be hidden by exclusion from WP Query. The safest and most effective method that hides post and its comments from all requests, RSS feeds, etc. on your site', 'ultimate-member' ),
|
||||
'value' => ! empty( $data['_um_access_hide_from_queries'] ) ? $data['_um_access_hide_from_queries'] : '',
|
||||
'conditional' => array( '_um_accessible', '!=', '0' ),
|
||||
|
||||
@@ -178,6 +178,63 @@ class Enqueue {
|
||||
return apply_filters( 'um_get_pickadate_locale', $locale, $suffix );
|
||||
}
|
||||
|
||||
/**
|
||||
* Select2 JS and CSS assets register function.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public function register_select2() {
|
||||
$suffix = self::get_suffix();
|
||||
$libs_url = self::get_url( 'libs' );
|
||||
|
||||
/**
|
||||
* Filters marker for dequeue select2.JS library.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @hook um_dequeue_select2_scripts
|
||||
*
|
||||
* @param {bool} $dequeue_select2 Dequeue select2 assets marker. Set to `true` for dequeue scripts.
|
||||
*
|
||||
* @return {bool} Dequeue select2 assets. By default `false`.
|
||||
*
|
||||
* @example <caption>Dequeue select2 assets.</caption>
|
||||
* function custom_um_dequeue_select2_scripts( $dequeue_select2 ) {
|
||||
* $dequeue_select2 = true;
|
||||
* return $dequeue_select2;
|
||||
* }
|
||||
* add_filter( 'um_dequeue_select2_scripts', 'custom_um_dequeue_select2_scripts' );
|
||||
*/
|
||||
$dequeue_select2 = apply_filters( 'um_dequeue_select2_scripts', false );
|
||||
if ( class_exists( 'WooCommerce' ) || $dequeue_select2 ) {
|
||||
wp_dequeue_style( 'select2' );
|
||||
wp_deregister_style( 'select2' );
|
||||
|
||||
wp_dequeue_script( 'select2' );
|
||||
wp_deregister_script( 'select2' );
|
||||
}
|
||||
wp_register_script( 'select2', $libs_url . 'select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.13', true );
|
||||
// Load a localized version for Select2.
|
||||
$locale = get_locale();
|
||||
$base_locale = get_locale();
|
||||
if ( $locale ) {
|
||||
if ( ! file_exists( UM_PATH . 'assets/libs/select2/i18n/' . $locale . '.js' ) ) {
|
||||
$locale = explode( '_', $base_locale );
|
||||
$locale = $locale[0];
|
||||
|
||||
if ( ! file_exists( UM_PATH . 'assets/libs/select2/i18n/' . $locale . '.js' ) ) {
|
||||
$locale = explode( '_', $base_locale );
|
||||
$locale = implode( '-', $locale );
|
||||
}
|
||||
}
|
||||
|
||||
if ( file_exists( UM_PATH . 'assets/libs/select2/i18n/' . $locale . '.js' ) ) {
|
||||
wp_register_script( 'um_select2_locale', $libs_url . 'select2/i18n/' . $locale . '.js', array( 'jquery', 'select2' ), '4.0.13', true );
|
||||
self::$select2_handle = 'um_select2_locale';
|
||||
}
|
||||
}
|
||||
wp_register_style( 'select2', $libs_url . 'select2/select2' . $suffix . '.css', array(), '4.0.13' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Register common JS/CSS libraries.
|
||||
*
|
||||
@@ -204,52 +261,7 @@ class Enqueue {
|
||||
wp_register_style( 'um_fonticons_fa', $libs_url . 'legacy/fonticons/fonticons-fa' . $suffix . '.css', array(), UM_VERSION ); // FontAwesome
|
||||
|
||||
// Select2 JS.
|
||||
/**
|
||||
* Filters marker for dequeue select2.JS library.
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @hook um_dequeue_select2_scripts
|
||||
*
|
||||
* @param {bool} $dequeue_select2 Dequeue select2 assets marker. Set to `true` for dequeue scripts.
|
||||
*
|
||||
* @return {bool} Dequeue select2 assets. By default `false`.
|
||||
*
|
||||
* @example <caption>Dequeue select2 assets.</caption>
|
||||
* function custom_um_dequeue_select2_scripts( $dequeue_select2 ) {
|
||||
* $dequeue_select2 = true;
|
||||
* return $dequeue_select2;
|
||||
* }
|
||||
* add_filter( 'um_dequeue_select2_scripts', 'custom_um_dequeue_select2_scripts' );
|
||||
*/
|
||||
$dequeue_select2 = apply_filters( 'um_dequeue_select2_scripts', false );
|
||||
if ( class_exists( 'WooCommerce' ) || $dequeue_select2 ) {
|
||||
wp_dequeue_style( self::$select2_handle );
|
||||
wp_deregister_style( self::$select2_handle );
|
||||
|
||||
wp_dequeue_script( self::$select2_handle );
|
||||
wp_deregister_script( self::$select2_handle );
|
||||
}
|
||||
wp_register_script( self::$select2_handle, $libs_url . 'select2/select2.full' . $suffix . '.js', array( 'jquery' ), '4.0.13', true );
|
||||
// Load a localized version for Select2.
|
||||
$locale = get_locale();
|
||||
$base_locale = get_locale();
|
||||
if ( $locale ) {
|
||||
if ( ! file_exists( UM_PATH . 'assets/libs/select2/i18n/' . $locale . '.js' ) ) {
|
||||
$locale = explode( '_', $base_locale );
|
||||
$locale = $locale[0];
|
||||
|
||||
if ( ! file_exists( UM_PATH . 'assets/libs/select2/i18n/' . $locale . '.js' ) ) {
|
||||
$locale = explode( '_', $base_locale );
|
||||
$locale = implode( '-', $locale );
|
||||
}
|
||||
}
|
||||
|
||||
if ( file_exists( UM_PATH . 'assets/libs/select2/i18n/' . $locale . '.js' ) ) {
|
||||
wp_register_script( 'um_select2_locale', $libs_url . 'select2/i18n/' . $locale . '.js', array( 'jquery', self::$select2_handle ), '4.0.13', true );
|
||||
self::$select2_handle = 'um_select2_locale';
|
||||
}
|
||||
}
|
||||
wp_register_style( 'select2', $libs_url . 'select2/select2' . $suffix . '.css', array(), '4.0.13' );
|
||||
$this->register_select2();
|
||||
|
||||
// Date-time picker (Pickadate.JS)
|
||||
wp_register_script( 'um_datetime', $libs_url . 'pickadate/picker' . $suffix . '.js', array( 'jquery' ), '3.6.2', true );
|
||||
|
||||
+201
-132
@@ -1,19 +1,23 @@
|
||||
<?php
|
||||
namespace um\core;
|
||||
|
||||
// Exit if accessed directly
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
use WP_Comment_Query;
|
||||
use WP_Post;
|
||||
use WP_Query;
|
||||
use WP_Term_Query;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
|
||||
|
||||
/**
|
||||
* Class Access
|
||||
* @package um\core
|
||||
*/
|
||||
class Access {
|
||||
|
||||
|
||||
/**
|
||||
* If true then we use individual restrict content options
|
||||
* for post
|
||||
@@ -22,30 +26,26 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*/
|
||||
private $singular_page;
|
||||
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $redirect_handler;
|
||||
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $allow_access;
|
||||
|
||||
|
||||
private $ignore_exclude = false;
|
||||
|
||||
|
||||
/**
|
||||
* Access constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
public function __construct() {
|
||||
$this->singular_page = false;
|
||||
|
||||
$this->redirect_handler = false;
|
||||
$this->allow_access = false;
|
||||
$this->allow_access = false;
|
||||
|
||||
// NEW HOOKS
|
||||
// Navigation line below the post content, change query to exclude restricted
|
||||
@@ -140,7 +140,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function exclude_posts_array( $force = false, $post_types = false ) {
|
||||
public function exclude_posts_array( $force = false, $post_types = false ) {
|
||||
if ( $this->ignore_exclude ) {
|
||||
return array();
|
||||
}
|
||||
@@ -335,16 +335,14 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $exclude_posts;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get array with restricted terms
|
||||
*
|
||||
* @param \WP_Term_Query $query
|
||||
* @param WP_Term_Query $query
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function exclude_terms_array( $query ) {
|
||||
public function exclude_terms_array( $query ) {
|
||||
$exclude = array();
|
||||
|
||||
$restricted_taxonomies = UM()->options()->get( 'restricted_access_taxonomy_metabox' );
|
||||
@@ -415,11 +413,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $exclude;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \WP_Term_Query $query
|
||||
* @param WP_Term_Query $query
|
||||
*/
|
||||
function exclude_hidden_terms_query( $query ) {
|
||||
public function exclude_hidden_terms_query( $query ) {
|
||||
if ( current_user_can( 'administrator' ) || ! empty( $query->query_vars['um_ignore_exclude'] ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -430,11 +427,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \WP_Query $query
|
||||
* @param WP_Query $query
|
||||
*/
|
||||
function exclude_posts( $query ) {
|
||||
public function exclude_posts( $query ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -472,16 +468,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exclude restricted post from query if there is a single query that exclude post_not_in by default in \WP_Query
|
||||
* Exclude restricted post from query if there is a single query that exclude post_not_in by default in WP_Query
|
||||
*
|
||||
* @param string $where
|
||||
* @param \WP_Query $query
|
||||
* @param string $where
|
||||
* @param WP_Query $query
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function exclude_posts_where( $where, $query ) {
|
||||
public function exclude_posts_where( $where, $query ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $where;
|
||||
}
|
||||
@@ -502,18 +497,17 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change the posts count based on restriction settings
|
||||
*
|
||||
* @param object $counts Post counts
|
||||
* @param string $type Post type
|
||||
* @param string $perm The permission to determine if the posts are 'readable'
|
||||
* by the current user.
|
||||
* @param string $type Post type
|
||||
* @param string $perm The permission to determine if the posts are 'readable'
|
||||
* by the current user.
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function custom_count_posts_handler( $counts, $type = 'post', $perm = '' ) {
|
||||
public function custom_count_posts_handler( $counts, $type = 'post', $perm = '' ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $counts;
|
||||
}
|
||||
@@ -565,7 +559,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $counts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exclude restricted posts in Recent Posts widget
|
||||
*
|
||||
@@ -573,7 +566,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function exclude_restricted_posts_widget( $array ) {
|
||||
public function exclude_restricted_posts_widget( $array ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $array;
|
||||
}
|
||||
@@ -587,7 +580,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exclude restricted posts in Recent Posts widget
|
||||
*
|
||||
@@ -595,7 +587,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function exclude_restricted_pages( $array ) {
|
||||
public function exclude_restricted_pages( $array ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $array;
|
||||
}
|
||||
@@ -608,16 +600,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exclude restricted posts in widgets
|
||||
*
|
||||
* @param string $sql_where
|
||||
* @param array $parsed_args
|
||||
* @param array $parsed_args
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function exclude_restricted_posts_archives_widget( $sql_where, $parsed_args = array() ) {
|
||||
public function exclude_restricted_posts_archives_widget( $sql_where, $parsed_args = array() ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $sql_where;
|
||||
}
|
||||
@@ -633,7 +624,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $sql_where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exclude posts from next, previous navigation
|
||||
*
|
||||
@@ -641,11 +631,11 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
* @param bool $in_same_term
|
||||
* @param string|array $excluded_terms
|
||||
* @param string $taxonomy
|
||||
* @param null|\WP_Post $post
|
||||
* @param null|WP_Post $post
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function exclude_navigation_posts( $where, $in_same_term = false, $excluded_terms = '', $taxonomy = 'category', $post = null ) {
|
||||
public function exclude_navigation_posts( $where, $in_same_term = false, $excluded_terms = '', $taxonomy = 'category', $post = null ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $where;
|
||||
}
|
||||
@@ -663,16 +653,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace titles of restricted posts
|
||||
* Replace titles of restricted posts.
|
||||
*
|
||||
* @param string $title
|
||||
* @param int|null $id
|
||||
* @param string $title Post title.
|
||||
* @param int|null $id Post ID.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function filter_restricted_post_title( $title, $id = null ) {
|
||||
public function filter_restricted_post_title( $title, $id = null ) {
|
||||
if ( ! UM()->options()->get( 'restricted_post_title_replace' ) ) {
|
||||
return $title;
|
||||
}
|
||||
@@ -689,6 +678,29 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
$id = absint( $id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a marker for ignoring restricted post title changes.
|
||||
*
|
||||
* @param {bool} $ignore Marker for ignoring restricted post title changes. Default `false`. Set to `true` if you want to ignore and show real title.
|
||||
* @param {int} $post_id Post ID.
|
||||
*
|
||||
* @return {bool} Marker for ignoring restricted post title changes.
|
||||
*
|
||||
* @since 2.2.3
|
||||
* @hook um_ignore_restricted_title
|
||||
*
|
||||
* @example <caption>Leave real post titles even they are restricted. By post ID (for ID = 400).</caption>
|
||||
* function change_restricted_title( $ignore, $id ) {
|
||||
* // your code here
|
||||
* if ( 400 === $id ) {
|
||||
* $ignore = true;
|
||||
* }
|
||||
* return $ignore;
|
||||
* }
|
||||
* add_filter( 'um_ignore_restricted_title', 'change_restricted_title', 10, 2 );
|
||||
* @example <caption>Leave real post titles even they are restricted. For all posts: site-wide logic.</caption>
|
||||
* add_filter( 'um_ignore_restricted_title', '__return_true' );
|
||||
*/
|
||||
$ignore = apply_filters( 'um_ignore_restricted_title', false, $id );
|
||||
if ( $ignore ) {
|
||||
return $title;
|
||||
@@ -696,21 +708,20 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
|
||||
if ( $this->is_restricted( $id ) ) {
|
||||
$restricted_global_title = UM()->options()->get( 'restricted_access_post_title' );
|
||||
$title = stripslashes( $restricted_global_title );
|
||||
$title = stripslashes( $restricted_global_title );
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace content of restricted posts
|
||||
* Replace content of restricted posts.
|
||||
*
|
||||
* @param string $content
|
||||
* @param string $content Post Content.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function filter_restricted_post_content( $content ) {
|
||||
public function filter_restricted_post_content( $content ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $content;
|
||||
}
|
||||
@@ -720,6 +731,31 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a marker for ignoring restricted post content changes.
|
||||
*
|
||||
* Note: Use with caution! You can make your posts not restricted by using this filter hook.
|
||||
*
|
||||
* @param {bool} $ignore Marker for ignoring restricted post content changes. Default `false`. Set to `true` if you want to ignore and show real content.
|
||||
* @param {int} $post_id Post ID.
|
||||
*
|
||||
* @return {bool} Marker for ignoring restricted post content changes.
|
||||
*
|
||||
* @since 2.2.3
|
||||
* @hook um_ignore_restricted_content
|
||||
*
|
||||
* @example <caption>Leave real post content even they are restricted. By post ID (for ID = 400).</caption>
|
||||
* function change_restricted_content( $ignore, $id ) {
|
||||
* // your code here
|
||||
* if ( 400 === $id ) {
|
||||
* $ignore = true;
|
||||
* }
|
||||
* return $ignore;
|
||||
* }
|
||||
* add_filter( 'um_ignore_restricted_content', 'change_restricted_content', 10, 2 );
|
||||
* @example <caption>Leave real post content even they are restricted. For all posts: site-wide logic.</caption>
|
||||
* add_filter( 'um_ignore_restricted_content', '__return_true' );
|
||||
*/
|
||||
$ignore = apply_filters( 'um_ignore_restricted_content', false, $id );
|
||||
if ( $ignore ) {
|
||||
return $content;
|
||||
@@ -741,16 +777,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Replace excerpt of restricted posts
|
||||
* Replace excerpt of restricted posts.
|
||||
*
|
||||
* @param string $post_excerpt
|
||||
* @param \WP_Post $post
|
||||
* @param string $post_excerpt Post Excerpt.
|
||||
* @param WP_Post $post WP_Post instance.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function filter_restricted_post_excerpt( $post_excerpt = '', $post = null ) {
|
||||
public function filter_restricted_post_excerpt( $post_excerpt = '', $post = null ) {
|
||||
if ( empty( $post ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
@@ -759,6 +794,31 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters a marker for ignoring restricted post excerpt changes.
|
||||
*
|
||||
* Note: Use with caution! You can make your posts not restricted by using this filter hook.
|
||||
*
|
||||
* @param {bool} $ignore Marker for ignoring restricted post excerpt changes. Default `false`. Set to `true` if you want to ignore and show real content.
|
||||
* @param {int} $post_id Post ID.
|
||||
*
|
||||
* @return {bool} Marker for ignoring restricted post excerpt changes.
|
||||
*
|
||||
* @since 2.2.3
|
||||
* @hook um_ignore_restricted_excerpt
|
||||
*
|
||||
* @example <caption>Leave real post excerpt even they are restricted. By post ID (for ID = 400).</caption>
|
||||
* function change_restricted_excerpt( $ignore, $id ) {
|
||||
* // your code here
|
||||
* if ( 400 === $id ) {
|
||||
* $ignore = true;
|
||||
* }
|
||||
* return $ignore;
|
||||
* }
|
||||
* add_filter( 'um_ignore_restricted_excerpt', 'change_restricted_excerpt', 10, 2 );
|
||||
* @example <caption>Leave real post excerpt even they are restricted. For all posts: site-wide logic.</caption>
|
||||
* add_filter( 'um_ignore_restricted_excerpt', '__return_true' );
|
||||
*/
|
||||
$ignore = apply_filters( 'um_ignore_restricted_excerpt', false, $post->ID );
|
||||
if ( $ignore ) {
|
||||
return $post_excerpt;
|
||||
@@ -771,16 +831,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $post_excerpt;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Hide attachment if the post is restricted
|
||||
*
|
||||
* @param string $url
|
||||
* @param int $attachment_id
|
||||
* @param int $attachment_id
|
||||
*
|
||||
* @return boolean|string
|
||||
*/
|
||||
function filter_attachment( $url, $attachment_id ) {
|
||||
public function filter_attachment( $url, $attachment_id ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $url;
|
||||
}
|
||||
@@ -788,7 +847,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return ( $attachment_id && $this->is_restricted( $attachment_id ) ) ? false : $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Hide attachment if the post is restricted
|
||||
*
|
||||
@@ -798,7 +856,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function filter_post_thumbnail( $has_thumbnail, $post = null, $thumbnail_id = false ) {
|
||||
public function filter_post_thumbnail( $has_thumbnail, $post = null, $thumbnail_id = false ) {
|
||||
if ( empty( $thumbnail_id ) ) {
|
||||
return $has_thumbnail;
|
||||
}
|
||||
@@ -825,14 +883,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $has_thumbnail;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Exclude comments from restricted posts in widgets
|
||||
*
|
||||
* @param \WP_Comment_Query $query
|
||||
* @param WP_Comment_Query $query
|
||||
*/
|
||||
function exclude_posts_comments( $query ) {
|
||||
public function exclude_posts_comments( $query ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return;
|
||||
}
|
||||
@@ -862,11 +918,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
function get_available_comments_post_types() {
|
||||
public function get_available_comments_post_types() {
|
||||
global $wp_taxonomies, $wpdb;
|
||||
|
||||
$restricted_posts = UM()->options()->get( 'restricted_access_post_metabox' );
|
||||
@@ -907,16 +962,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $restricted_posts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Exclude comments from comments feed
|
||||
*
|
||||
* @param string $where
|
||||
* @param \WP_Query $query
|
||||
* @param string $where
|
||||
* @param WP_Query $query
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function exclude_posts_comments_feed( $where, $query ) {
|
||||
public function exclude_posts_comments_feed( $where, $query ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $where;
|
||||
}
|
||||
@@ -924,20 +978,19 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
$exclude_posts = $this->exclude_posts_array( true, $this->get_available_comments_post_types() );
|
||||
if ( ! empty( $exclude_posts ) ) {
|
||||
$exclude_string = implode( ',', $exclude_posts );
|
||||
$where .= ' AND comment_post_ID NOT IN ( ' . $exclude_string . ' )';
|
||||
$where .= ' AND comment_post_ID NOT IN ( ' . $exclude_string . ' )';
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array|object $stats
|
||||
* @param int $post_id Post ID. Can be 0 for the whole website
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function custom_comments_count_handler( $stats = array(), $post_id = 0 ) {
|
||||
public function custom_comments_count_handler( $stats = array(), $post_id = 0 ) {
|
||||
if ( ! empty( $stats ) || current_user_can( 'administrator' ) ) {
|
||||
return $stats;
|
||||
}
|
||||
@@ -963,14 +1016,13 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $stats_object;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param int $post_id
|
||||
* @param array $exclude_posts
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_comment_count( $post_id = 0, $exclude_posts = array() ) {
|
||||
public function get_comment_count( $post_id = 0, $exclude_posts = array() ) {
|
||||
static $cache = array();
|
||||
|
||||
if ( isset( $cache[ $post_id ] ) ) {
|
||||
@@ -1044,15 +1096,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $comment_count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disable comments if user has not permission to access this post
|
||||
*
|
||||
* @param mixed $open
|
||||
* @param int $post_id
|
||||
* @return boolean
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function disable_comments_open( $open, $post_id ) {
|
||||
public function disable_comments_open( $open, $post_id ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $open;
|
||||
}
|
||||
@@ -1074,15 +1126,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $open;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Disable comments if user has not permission to access this post
|
||||
*
|
||||
* @param int $count
|
||||
* @param int $post_id
|
||||
* @return boolean
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function disable_comments_open_number( $count, $post_id = 0 ) {
|
||||
public function disable_comments_open_number( $count, $post_id = 0 ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $count;
|
||||
}
|
||||
@@ -1104,15 +1156,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Protect Post Types in menu query
|
||||
* Restrict content new logic
|
||||
* @param array $menu_items
|
||||
* @param array $args
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function filter_menu( $menu_items, $args = array() ) {
|
||||
public function filter_menu( $menu_items, $args = array() ) {
|
||||
//if empty
|
||||
if ( empty( $menu_items ) ) {
|
||||
return $menu_items;
|
||||
@@ -1159,14 +1211,13 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $filtered_items;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $block_content
|
||||
* @param $block
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function restrict_blocks( $block_content, $block ) {
|
||||
public function restrict_blocks( $block_content, $block ) {
|
||||
if ( is_admin() ) {
|
||||
return $block_content;
|
||||
}
|
||||
@@ -1246,13 +1297,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \WP_Post $post
|
||||
* @param WP_Post $post
|
||||
*
|
||||
* @return \WP_Post
|
||||
* @return WP_Post
|
||||
*/
|
||||
function maybe_replace_title( $post ) {
|
||||
public function maybe_replace_title( $post ) {
|
||||
if ( ! UM()->options()->get( 'restricted_post_title_replace' ) ) {
|
||||
return $post;
|
||||
}
|
||||
@@ -1261,28 +1311,28 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $post;
|
||||
}
|
||||
|
||||
if ( ! is_a( $post, '\WP_Post' ) ) {
|
||||
if ( ! is_a( $post, WP_Post::class ) ) {
|
||||
return $post;
|
||||
}
|
||||
|
||||
/** This filter is documented in includes/core/class-access.php */
|
||||
$ignore = apply_filters( 'um_ignore_restricted_title', false, $post->ID );
|
||||
if ( $ignore ) {
|
||||
return $post;
|
||||
}
|
||||
|
||||
$restricted_global_title = UM()->options()->get( 'restricted_access_post_title' );
|
||||
$post->post_title = stripslashes( $restricted_global_title );
|
||||
$post->post_title = stripslashes( $restricted_global_title );
|
||||
|
||||
return $post;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param \WP_Post $nav_item
|
||||
* @param WP_Post $nav_item
|
||||
*
|
||||
* @return \WP_Post
|
||||
* @return WP_Post
|
||||
*/
|
||||
function maybe_replace_nav_menu_title( $nav_item ) {
|
||||
public function maybe_replace_nav_menu_title( $nav_item ) {
|
||||
if ( ! UM()->options()->get( 'restricted_post_title_replace' ) ) {
|
||||
return $nav_item;
|
||||
}
|
||||
@@ -1291,7 +1341,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $nav_item;
|
||||
}
|
||||
|
||||
if ( ! is_a( $nav_item, '\WP_Post' ) ) {
|
||||
if ( ! is_a( $nav_item, WP_Post::class ) ) {
|
||||
return $nav_item;
|
||||
}
|
||||
|
||||
@@ -1306,21 +1356,21 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $nav_item;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Protect Post Types in query
|
||||
* Restrict content new logic
|
||||
*
|
||||
* @param array $posts
|
||||
* @param array|\WP_Query $query
|
||||
* @param array $posts Posts query result.
|
||||
* @param array|WP_Query $query WP_Query instance.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function filter_protected_posts( $posts, $query ) {
|
||||
public function filter_protected_posts( $posts, $query ) {
|
||||
if ( current_user_can( 'administrator' ) ) {
|
||||
return $posts;
|
||||
}
|
||||
|
||||
//Woocommerce AJAX fixes....remove filtration on wc-ajax which goes to Front Page
|
||||
// Woocommerce AJAX fixes....remove filtration on wc-ajax which goes to Front Page.
|
||||
if ( ! empty( $_GET['wc-ajax'] ) && defined( 'WC_DOING_AJAX' ) && WC_DOING_AJAX ) {
|
||||
return $posts;
|
||||
}
|
||||
@@ -1336,8 +1386,8 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
$is_singular = ! empty( $query->is_singular ) ? true : false;
|
||||
}
|
||||
|
||||
if ( is_object( $query ) && is_a( $query, '\WP_Query' ) &&
|
||||
( $query->is_main_query() || ! empty( $query->query_vars['um_main_query'] ) ) ) {
|
||||
if ( is_object( $query ) && is_a( $query, WP_Query::class ) &&
|
||||
( $query->is_main_query() || ! empty( $query->query_vars['um_main_query'] ) ) ) {
|
||||
if ( $is_singular ) {
|
||||
if ( ! UM()->options()->get( 'disable_restriction_pre_queries' ) && $this->is_restricted( $posts[0]->ID ) ) {
|
||||
$content_restriction = $this->get_post_privacy_settings( $posts[0]->ID );
|
||||
@@ -1394,7 +1444,30 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*/
|
||||
do_action( 'um_access_fix_external_post_content' );
|
||||
|
||||
$filtered_posts[] = $this->maybe_replace_title( $post );
|
||||
$filtered_post = $this->maybe_replace_title( $post );
|
||||
/**
|
||||
* Filters restricted via Ultimate Member settings post instance.
|
||||
*
|
||||
* @param {object} $filtered_post Restricted `WP_Post` instance.
|
||||
* @param {object} $post Base `WP_Post` instance before restriction settings apply.
|
||||
* @param {object} $query `WP_Query` for getting posts.
|
||||
*
|
||||
* @return {object} Restricted `WP_Post` instance.
|
||||
*
|
||||
* @since 2.8.2
|
||||
* @hook um_access_restricted_post_instance
|
||||
*
|
||||
* @example <caption>Change restricted post title to custom one.</caption>
|
||||
* function restricted_post_instance( $filtered_post, $original_post, $query ) {
|
||||
* // your code here
|
||||
* $filtered_post->post_title = 'This post is restricted';
|
||||
* return $filtered_post;
|
||||
* }
|
||||
* add_filter( 'um_access_restricted_post_instance', 'restricted_post_instance', 10, 3 );
|
||||
*/
|
||||
$filtered_post = apply_filters( 'um_access_restricted_post_instance', $filtered_post, $post, $query );
|
||||
|
||||
$filtered_posts[] = $filtered_post;
|
||||
continue;
|
||||
}
|
||||
} elseif ( '1' == $restriction['_um_noaccess_action'] ) {
|
||||
@@ -1417,7 +1490,11 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
} else {
|
||||
if ( empty( $restriction['_um_access_hide_from_queries'] ) || UM()->options()->get( 'disable_restriction_pre_queries' ) ) {
|
||||
$filtered_posts[] = $this->maybe_replace_title( $post );
|
||||
$filtered_post = $this->maybe_replace_title( $post );
|
||||
/** This filter is documented in includes/core/class-access.php */
|
||||
$filtered_post = apply_filters( 'um_access_restricted_post_instance', $filtered_post, $post, $query );
|
||||
|
||||
$filtered_posts[] = $filtered_post;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1427,13 +1504,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $filtered_posts;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set custom access actions and redirection
|
||||
*
|
||||
* Old global restrict content logic
|
||||
*/
|
||||
function template_redirect() {
|
||||
public function template_redirect() {
|
||||
global $post, $wp_query;
|
||||
|
||||
//if we logged by administrator it can access to all content
|
||||
@@ -1532,11 +1608,10 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
$this->check_access();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check Blog page Content Restriction settings
|
||||
*/
|
||||
function um_access_check_blog_page_settings() {
|
||||
public function um_access_check_blog_page_settings() {
|
||||
global $wp_query;
|
||||
|
||||
if ( ! empty( $wp_query->is_home ) && ! empty( $wp_query->is_posts_page ) ) {
|
||||
@@ -1574,7 +1649,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
/**
|
||||
* Check individual term Content Restriction settings
|
||||
*/
|
||||
function um_access_check_individual_term_settings() {
|
||||
public function um_access_check_individual_term_settings() {
|
||||
//check only tax|tags|categories - skip archive, author, and date lists
|
||||
if ( ! ( is_tax() || is_tag() || is_category() ) ) {
|
||||
return;
|
||||
@@ -1627,7 +1702,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $template
|
||||
* @param $type
|
||||
@@ -1635,7 +1709,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function taxonomy_message( $template, $type, $templates ) {
|
||||
public function taxonomy_message( $template, $type, $templates ) {
|
||||
return UM()->locate_template( 'restricted-taxonomy.php' );
|
||||
}
|
||||
|
||||
@@ -1646,15 +1720,14 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function blog_message( $template, $type, $templates ) {
|
||||
public function blog_message( $template, $type, $templates ) {
|
||||
return UM()->locate_template( 'restricted-blog.php' );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check global accessible settings
|
||||
*/
|
||||
function um_access_check_global_settings() {
|
||||
public function um_access_check_global_settings() {
|
||||
global $post;
|
||||
|
||||
$curr = UM()->permalinks()->get_current_url();
|
||||
@@ -1776,13 +1849,12 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check access
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function check_access() {
|
||||
public function check_access() {
|
||||
if ( $this->allow_access === true ) {
|
||||
return true;
|
||||
}
|
||||
@@ -1795,7 +1867,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends a HTTP header to limit rendering of pages to same origin iframes when loading sensitive pages.
|
||||
*
|
||||
@@ -1812,7 +1883,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets a custom access referer in a redirect URL
|
||||
*
|
||||
@@ -1821,7 +1891,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function set_referer( $url, $referer ) {
|
||||
public function set_referer( $url, $referer ) {
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
@@ -1852,13 +1922,13 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get privacy settings for post
|
||||
* return false if post is not private
|
||||
* Restrict content new logic
|
||||
*
|
||||
* @param \WP_Post|int $post Post ID or object
|
||||
* @param WP_Post|int $post Post ID or object
|
||||
*
|
||||
* @return bool|array
|
||||
*/
|
||||
public function get_post_privacy_settings( $post ) {
|
||||
@@ -1867,7 +1937,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! is_numeric( $post ) && ! is_a( $post, \WP_Post::class ) ) {
|
||||
if ( ! is_numeric( $post ) && ! is_a( $post, WP_Post::class ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2014,15 +2084,15 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper for checking if the user can some of the roles array
|
||||
*
|
||||
* @param $user_id
|
||||
* @param $roles
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function user_can( $user_id, $roles ) {
|
||||
public function user_can( $user_id, $roles ) {
|
||||
$user_can = false;
|
||||
|
||||
if ( ! empty( $roles ) ) {
|
||||
@@ -2037,7 +2107,6 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $user_can;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper for 3rd-party integrations with content restriction settings
|
||||
*
|
||||
@@ -2045,7 +2114,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function um_custom_restriction( $restriction ) {
|
||||
public function um_custom_restriction( $restriction ) {
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
@@ -2070,16 +2139,16 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return apply_filters( 'um_custom_restriction', true, $restriction );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is post restricted?
|
||||
*
|
||||
* @param int $post_id
|
||||
* @param bool $on_single_page
|
||||
* @param bool $ignore_cache
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_restricted( $post_id, $on_single_page = false, $ignore_cache = false ) {
|
||||
public function is_restricted( $post_id, $on_single_page = false, $ignore_cache = false ) {
|
||||
// break for incorrect post
|
||||
if ( empty( $post_id ) ) {
|
||||
return false;
|
||||
@@ -2169,16 +2238,16 @@ if ( ! class_exists( 'um\core\Access' ) ) {
|
||||
return $restricted;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Is term restricted?
|
||||
*
|
||||
* @param int $term_id
|
||||
* @param bool $on_term_page
|
||||
* @param bool $ignore_cache
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function is_restricted_term( $term_id, $on_term_page = false, $ignore_cache = false ) {
|
||||
public function is_restricted_term( $term_id, $on_term_page = false, $ignore_cache = false ) {
|
||||
static $cache = array();
|
||||
|
||||
if ( isset( $cache[ $term_id ] ) && ! $ignore_cache ) {
|
||||
|
||||
@@ -2963,7 +2963,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
} else {
|
||||
$img_value = UM()->files()->get_download_link( $this->set_id, $key, um_user( 'ID' ) );
|
||||
}
|
||||
$img = '<img src="' . esc_attr( $img_value ) . '" alt="" />';
|
||||
$img = '<img class="fusion-lazyload-ignore" src="' . esc_attr( $img_value ) . '" alt="" />';
|
||||
} else {
|
||||
$img = '';
|
||||
}
|
||||
@@ -2981,7 +2981,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
if ( empty( $disabled ) ) {
|
||||
$output .= '<a href="javascript:void(0);" class="cancel"><i class="um-icon-close"></i></a>';
|
||||
}
|
||||
$output .= '<img src="" alt="" /><div class="um-clear"></div></div>';
|
||||
$output .= '<img class="fusion-lazyload-ignore" src="" alt="" /><div class="um-clear"></div></div>';
|
||||
if ( empty( $disabled ) ) {
|
||||
$output .= '<a href="javascript:void(0);" data-modal="um_upload_single" data-modal-size="' . esc_attr( $data['modal_size'] ) . '" data-modal-copy="1" class="um-button um-btn-auto-width">' . esc_html( $data['button_text'] ) . '</a>';
|
||||
}
|
||||
@@ -3014,7 +3014,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
$nonce = wp_create_nonce( 'um_upload_nonce-' . $this->timestamp );
|
||||
$output .= '<div class="um-single-image-preview ' . esc_attr( $data['crop_class'] ) . '" data-crop="' . esc_attr( $data['crop_data'] ) . '" data-ratio="' . esc_attr( $data['ratio'] ) . '" data-min_width="' . esc_attr( $data['min_width'] ) . '" data-min_height="' . esc_attr( $data['min_height'] ) . '" data-coord=""><a href="javascript:void(0);" class="cancel"><i class="um-icon-close"></i></a><img src="" alt="" /><div class="um-clear"></div></div><div class="um-clear"></div>';
|
||||
$output .= '<div class="um-single-image-preview ' . esc_attr( $data['crop_class'] ) . '" data-crop="' . esc_attr( $data['crop_data'] ) . '" data-ratio="' . esc_attr( $data['ratio'] ) . '" data-min_width="' . esc_attr( $data['min_width'] ) . '" data-min_height="' . esc_attr( $data['min_height'] ) . '" data-coord=""><a href="javascript:void(0);" class="cancel"><i class="um-icon-close"></i></a><img class="fusion-lazyload-ignore" src="" alt="" /><div class="um-clear"></div></div><div class="um-clear"></div>';
|
||||
$output .= '<div class="um-single-image-upload" data-user_id="' . esc_attr( $_um_profile_id ) . '" data-nonce="' . esc_attr( $nonce ) . '" data-timestamp="' . esc_attr( $this->timestamp ) . '" ' . $data_icon . ' data-set_id="' . esc_attr( $set_id ) . '" data-set_mode="' . esc_attr( $set_mode ) . '" data-type="' . esc_attr( $type ) . '" data-key="' . esc_attr( $key ) . '" data-max_size="' . esc_attr( $data['max_size'] ) . '" data-max_size_error="' . esc_attr( $data['max_size_error'] ) . '" data-min_size_error="' . esc_attr( $data['min_size_error'] ) . '" data-extension_error="' . esc_attr( $data['extension_error'] ) . '" data-allowed_types="' . esc_attr( $allowed_types ) . '" data-upload_text="' . esc_attr( $data['upload_text'] ) . '" data-max_files_error="' . esc_attr( $data['max_files_error'] ) . '" data-upload_help_text="' . esc_attr( $data['upload_help_text'] ) . '">' . esc_html( $data['button_text'] ) . '</div>';
|
||||
$output .= '<div class="um-modal-footer">
|
||||
<div class="um-modal-right">
|
||||
|
||||
@@ -817,8 +817,8 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
$label = ! empty( $attrs['label'] ) ? $attrs['label'] : $attrs['title'];
|
||||
|
||||
if ( $range ) {
|
||||
$min = strtotime( $range[0] );
|
||||
$max = strtotime( $range[1] );
|
||||
$min = $range[0];
|
||||
$max = $range[1];
|
||||
?>
|
||||
<input type="text" id="<?php echo $filter; ?>_from" name="<?php echo $filter; ?>_from" class="um-datepicker-filter"
|
||||
placeholder="<?php esc_attr_e( sprintf( '%s From', stripslashes( $label ) ), 'ultimate-member' ); ?>"
|
||||
@@ -1031,7 +1031,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
if ( empty( $meta['total'] ) || 1 === absint( $meta['total'] ) ) {
|
||||
$range = false;
|
||||
} elseif ( array_key_exists( 'min', $meta ) && array_key_exists( 'max', $meta ) ) {
|
||||
$range = array( $meta['min'], $meta['max'] );
|
||||
$range = array( strtotime( $meta['min'] ), strtotime( $meta['max'] ) );
|
||||
}
|
||||
break;
|
||||
case 'user_registered':
|
||||
|
||||
@@ -74,6 +74,8 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
add_shortcode( 'um_show_content', array( &$this, 'um_shortcode_show_content_for_role' ) );
|
||||
add_shortcode( 'ultimatemember_searchform', array( &$this, 'ultimatemember_searchform' ) );
|
||||
|
||||
add_shortcode( 'um_author_profile_link', array( &$this, 'author_profile_link' ) );
|
||||
|
||||
add_filter( 'body_class', array( &$this, 'body_class' ), 0 );
|
||||
|
||||
add_filter( 'um_shortcode_args_filter', array( &$this, 'display_logout_form' ), 99 );
|
||||
@@ -257,7 +259,7 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
|
||||
foreach ( $array as $slug => $info ) {
|
||||
if ( um_is_core_page( $slug ) ) {
|
||||
$classes[] = 'um';
|
||||
$classes[] = 'um-page';
|
||||
$classes[] = 'um-page-' . $slug;
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
@@ -458,6 +460,63 @@ if ( ! class_exists( 'um\core\Shortcodes' ) ) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display post author's link to UM User Profile.
|
||||
*
|
||||
* @since 2.8.2
|
||||
*
|
||||
* Example 1: [um_author_profile_link] current post author User Profile URL
|
||||
* Example 2: [um_author_profile_link title="User profile" user_id="29"]
|
||||
* Example 3: [um_author_profile_link title="User profile" user_id="29"]Visit Author Profile[/um_author_profile_link]
|
||||
* Example 4: [um_author_profile_link raw="1"] for result like http://localhost:8000/user/janedoe/
|
||||
*
|
||||
* @param array $attr {
|
||||
* Attributes of the shortcode.
|
||||
*
|
||||
* @type string $class A link class.
|
||||
* @type string $title A link text.
|
||||
* @type int $user_id User ID. Author ID if empty.
|
||||
* @type bool $raw Get raw URL or link layout. `false` by default.
|
||||
* }
|
||||
* @param string $content
|
||||
* @return string Profile link HTML or profile link URL if the link text is empty.
|
||||
*/
|
||||
public function author_profile_link( $attr = array(), $content = '' ) {
|
||||
$default_user_id = 0;
|
||||
if ( is_singular() ) {
|
||||
$default_user_id = get_post()->post_author;
|
||||
} elseif ( is_author() ) {
|
||||
$default_user_id = get_the_author_meta( 'ID' );
|
||||
}
|
||||
|
||||
$defaults_atts = array(
|
||||
'class' => 'um-link um-profile-link',
|
||||
'title' => __( 'Go to profile', 'ultimate-member' ),
|
||||
'user_id' => $default_user_id,
|
||||
'raw' => false,
|
||||
);
|
||||
|
||||
$atts = shortcode_atts( $defaults_atts, $attr, 'um_author_profile_link' );
|
||||
|
||||
if ( empty( $atts['user_id'] ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$user_id = absint( $atts['user_id'] );
|
||||
$url = um_user_profile_url( $user_id );
|
||||
if ( empty( $url ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if ( ! empty( $atts['raw'] ) ) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
$title = ! empty( $atts['title'] ) ? $atts['title'] : __( 'Go to profile', 'ultimate-member' );
|
||||
$link_html = empty( $content ) ? $title : $content;
|
||||
|
||||
return '<a class="' . esc_attr( $atts['class'] ) . '" href="' . esc_url( $url ) . '" title="' . esc_attr( $title ) . '">' . wp_kses_post( $link_html ) . '</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $args
|
||||
|
||||
@@ -811,79 +811,79 @@ add_filter('um_profile_field_filter_hook__multiselect','um_option_match_callback
|
||||
add_filter('um_field_select_default_value','um_option_match_callback_view_field', 10, 2);
|
||||
add_filter('um_field_multiselect_default_value','um_option_match_callback_view_field', 10, 2);
|
||||
|
||||
|
||||
/**
|
||||
* Apply textdomain in select/multi-select options
|
||||
*
|
||||
* @param $value string
|
||||
* @param $data array
|
||||
* @param string $value
|
||||
* @param array $data
|
||||
*
|
||||
* @return string
|
||||
* @uses hook filters: um_profile_field_filter_hook__select, um_profile_field_filter_hook__multiselect
|
||||
*/
|
||||
|
||||
function um_profile_field__select_translate( $value, $data ) {
|
||||
if ( empty( $value ) ) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
if ( empty( $value ) ) return $value;
|
||||
$options = explode( ', ', $value );
|
||||
|
||||
$options = explode(", ", $value );
|
||||
$arr_options = array();
|
||||
if( is_array( $options ) ){
|
||||
if ( is_array( $options ) ) {
|
||||
foreach ( $options as $item ) {
|
||||
$arr_options[] = __( $item, 'ultimate-member' );
|
||||
}
|
||||
}
|
||||
|
||||
$value = implode(", ", $arr_options);
|
||||
|
||||
return $value;
|
||||
return implode( ', ', $arr_options );
|
||||
}
|
||||
add_filter( 'um_profile_field_filter_hook__select','um_profile_field__select_translate', 10, 2 );
|
||||
add_filter( 'um_profile_field_filter_hook__multiselect','um_profile_field__select_translate', 10, 2 );
|
||||
|
||||
|
||||
/**
|
||||
* Cleaning on XSS injection
|
||||
* @param $value string
|
||||
* @param $data array
|
||||
* @param string $type
|
||||
* @return string $value
|
||||
* Cleaning on XSS injection.
|
||||
*
|
||||
* @param int|string|array $value
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
*
|
||||
* @return int|string
|
||||
* @uses hook filters: um_profile_field_filter_hook__
|
||||
*/
|
||||
function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
if ( ! empty( $value ) && is_string( $value ) ) {
|
||||
$value = stripslashes( $value );
|
||||
$value = stripslashes( $value );
|
||||
$data['validate'] = isset( $data['validate'] ) ? $data['validate'] : '';
|
||||
|
||||
if ( 'text' == $type && ! in_array( $data['validate'], array( 'unique_email' ) ) || 'password' == $type ) {
|
||||
if ( ( 'text' === $type && 'unique_email' !== $data['validate'] ) || 'password' === $type ) {
|
||||
$value = esc_attr( $value );
|
||||
} elseif ( $type == 'url' ) {
|
||||
} elseif ( 'url' === $type ) {
|
||||
$value = esc_url( $value );
|
||||
} elseif ( 'textarea' == $type ) {
|
||||
} elseif ( 'textarea' === $type ) {
|
||||
if ( empty( $data['html'] ) ) {
|
||||
$value = wp_kses_post( $value );
|
||||
}
|
||||
} elseif ( 'rating' == $type ) {
|
||||
} elseif ( 'rating' === $type ) {
|
||||
if ( ! is_numeric( $value ) ) {
|
||||
$value = 0;
|
||||
} else {
|
||||
if ( $data['number'] == 5 ) {
|
||||
if ( ! in_array( $value, range( 1, 5 ) ) ) {
|
||||
if ( 5 === absint( $data['number'] ) ) {
|
||||
if ( ! in_array( $value, range( 1, 5 ), true ) ) {
|
||||
$value = 0;
|
||||
}
|
||||
} elseif ( $data['number'] == 10 ) {
|
||||
if ( ! in_array( $value, range( 1, 10 ) ) ) {
|
||||
} elseif ( 10 === $data['number'] ) {
|
||||
if ( ! in_array( $value, range( 1, 10 ), true ) ) {
|
||||
$value = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ( 'select' == $type || 'radio' == $type ) {
|
||||
} elseif ( 'select' === $type || 'radio' === $type ) {
|
||||
|
||||
/** This filter is documented in includes/core/class-fields.php */
|
||||
$option_pairs = apply_filters( 'um_select_options_pair', null, $data );
|
||||
|
||||
$array = empty( $data['options'] ) ? array() : $data['options'];
|
||||
|
||||
if ( $data['metakey'] == 'country' && empty( $array ) ) {
|
||||
if ( 'country' === $data['metakey'] && empty( $array ) ) {
|
||||
$array = UM()->builtin()->get( 'countries' );
|
||||
}
|
||||
|
||||
@@ -893,6 +893,8 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
$arr = $array;
|
||||
}
|
||||
|
||||
$arr = array_map( 'stripslashes', $arr );
|
||||
|
||||
if ( ! empty( $arr ) && ! in_array( $value, array_map( 'trim', $arr ) ) && empty( $data['custom_dropdown_options_source'] ) ) {
|
||||
$value = '';
|
||||
} else {
|
||||
@@ -902,7 +904,7 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
}
|
||||
}
|
||||
} elseif ( ! empty( $value ) && is_array( $value ) ) {
|
||||
if ( 'multiselect' == $type || 'checkbox' == $type ) {
|
||||
if ( 'multiselect' === $type || 'checkbox' === $type ) {
|
||||
|
||||
/** This filter is documented in includes/core/class-fields.php */
|
||||
$option_pairs = apply_filters( 'um_select_options_pair', null, $data );
|
||||
@@ -913,8 +915,8 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
}
|
||||
|
||||
if ( ! empty( $arr ) && empty( $data['custom_dropdown_options_source'] ) ) {
|
||||
$arr = wp_unslash( $arr );
|
||||
$arr = wp_slash( array_map( 'trim', $arr ) );
|
||||
$arr = wp_unslash( $arr );
|
||||
$arr = wp_slash( array_map( 'trim', $arr ) );
|
||||
$value = array_intersect( $value, $arr );
|
||||
}
|
||||
|
||||
@@ -930,7 +932,6 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
}
|
||||
add_filter( 'um_profile_field_filter_hook__', 'um_profile_field_filter_xss_validation', 10, 3 );
|
||||
|
||||
|
||||
/**
|
||||
* Trim All form POST submitted data
|
||||
*
|
||||
|
||||
@@ -63,6 +63,13 @@ if ( ! is_admin() ) {
|
||||
//other filter
|
||||
foreach ( $menu_items as $item ) {
|
||||
if ( empty( $item->ID ) ) {
|
||||
// Left item with empty ID for the cases like in MegaMenu when generated submenu doesn't have the menu item ID.
|
||||
if ( ! empty( $item->is_mega_menu ) ) {
|
||||
if ( isset( $item->menu_item_parent ) && in_array( absint( $item->menu_item_parent ), $hide_children_of, true ) ) {
|
||||
continue;
|
||||
}
|
||||
$filtered_items[] = $item;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -186,9 +186,12 @@ final class Enqueue extends \um\common\Enqueue {
|
||||
wp_register_style( 'um_rtl', $css_url . 'um.rtl' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_register_style( 'um_default_css', $css_url . 'um-old-default' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_register_style( 'um_modal', $css_url . 'um-modal' . $suffix . '.css', array(), UM_VERSION );
|
||||
wp_register_style( 'um_responsive', $css_url . 'um-responsive' . $suffix . '.css', array( 'um_profile' ), UM_VERSION );
|
||||
wp_register_style( 'um_responsive', $css_url . 'um-responsive' . $suffix . '.css', array(), UM_VERSION );
|
||||
|
||||
wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2', 'um_fileupload', 'um_common' ), UM_VERSION );
|
||||
// Workaround when select2 deregistered (e.g. Woo + Impreza theme activated).
|
||||
$this->register_select2();
|
||||
|
||||
wp_register_style( 'um_styles', $css_url . 'um-styles' . $suffix . '.css', array( 'um_ui', 'um_tipsy', 'um_raty', 'um_fonticons_ii', 'um_fonticons_fa', 'select2', 'um_fileupload', 'um_common', 'um_responsive', 'um_modal' ), UM_VERSION );
|
||||
|
||||
wp_register_style( 'um_members', $css_url . 'um-members' . $suffix . '.css', array( 'um_styles' ), UM_VERSION );
|
||||
// RTL styles.
|
||||
|
||||
+29
-1
@@ -7,7 +7,7 @@ Tags: community, member, membership, user-profile, user-registration
|
||||
Requires PHP: 5.6
|
||||
Requires at least: 5.5
|
||||
Tested up to: 6.4
|
||||
Stable tag: 2.8.1
|
||||
Stable tag: 2.8.2
|
||||
License: GNU Version 2 or Any Later Version
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
@@ -166,6 +166,34 @@ No specific extensions are needed. But we highly recommended keep active these P
|
||||
|
||||
IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
|
||||
|
||||
= 2.8.2: January 15, 2024 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
- Added: The `data` protocol for embedding base64 encoded logos in emails
|
||||
- Added: Hook `um_access_restricted_post_instance` for filtering the restricted post instance
|
||||
- Added: Shortcode `[um_author_profile_link]` for getting user Profile URL
|
||||
- Updated: Using underscore.js native debounce method for resize handler
|
||||
- Updated: Texts spelling
|
||||
|
||||
* Bugfixes:
|
||||
|
||||
- Fixed: AJAX requests conflict with `um_current_locale` attribute
|
||||
- Fixed: Pickadate styling (Date & Time fields) in wp-admin screen
|
||||
- Fixed: RTL styling and removed `um` class from UM frontend predefined pages
|
||||
- Fixed: select2 conflict with Impreza theme
|
||||
- Fixed: cropper conflict with Avada theme and active Fusion Image lazyload
|
||||
- Fixed: MegaMenu conflict with nav menu items conditional settings (e.g. Newsletter theme)
|
||||
- Fixed: PHP Fatal error when there isn't a proper WP_Post object in UM User Profile > Posts loop
|
||||
- Fixed: Account styles
|
||||
- Fixed: Saving `um_form_version` postmeta
|
||||
|
||||
* Templates required update:
|
||||
|
||||
- profile/posts-single.php
|
||||
|
||||
* Cached and optimized/minified assets(JS/CSS) must be flushed/re-generated after upgrade
|
||||
|
||||
= 2.8.1: December 20, 2023 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* Page: "Profile"
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @version 2.8.2
|
||||
*
|
||||
* @var object $post
|
||||
*/
|
||||
@@ -34,21 +34,26 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
}
|
||||
|
||||
$unix_published_date = get_post_datetime( $post, 'date', 'gmt' );
|
||||
$categories_list = get_the_category_list( ', ', '', $post->ID );
|
||||
?>
|
||||
|
||||
<div class="um-item-meta">
|
||||
<span>
|
||||
<?php
|
||||
// translators: %s: human time diff.
|
||||
echo esc_html( sprintf( __( '%s ago', 'ultimate-member' ), human_time_diff( $unix_published_date->getTimestamp() ) ) );
|
||||
?>
|
||||
</span>
|
||||
<span>
|
||||
<?php
|
||||
// translators: %s: categories list.
|
||||
echo wp_kses( sprintf( __( 'in: %s', 'ultimate-member' ), get_the_category_list( ', ', '', $post->ID ) ), UM()->get_allowed_html( 'templates' ) );
|
||||
?>
|
||||
</span>
|
||||
<?php if ( false !== $unix_published_date ) { ?>
|
||||
<span>
|
||||
<?php
|
||||
// translators: %s: human time diff.
|
||||
echo esc_html( sprintf( __( '%s ago', 'ultimate-member' ), human_time_diff( $unix_published_date->getTimestamp() ) ) );
|
||||
?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<?php if ( ! empty( $categories_list ) ) { ?>
|
||||
<span>
|
||||
<?php
|
||||
// translators: %s: categories list.
|
||||
echo wp_kses( sprintf( __( 'in: %s', 'ultimate-member' ), $categories_list ), UM()->get_allowed_html( 'templates' ) );
|
||||
?>
|
||||
</span>
|
||||
<?php } ?>
|
||||
<span>
|
||||
<?php
|
||||
$num_comments = absint( get_comments_number( $post ) );
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
* Plugin Name: Ultimate Member
|
||||
* Plugin URI: http://ultimatemember.com/
|
||||
* Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
||||
* Version: 2.8.1
|
||||
* Version: 2.8.2
|
||||
* Author: Ultimate Member
|
||||
* Author URI: http://ultimatemember.com/
|
||||
* Text Domain: ultimate-member
|
||||
|
||||
Reference in New Issue
Block a user