Update ACF

Signed-off-by: cjyabraham <cjyabraham@gmail.com>
This commit is contained in:
cjyabraham 2023-03-11 14:16:26 -08:00
parent 99b1aa03f5
commit c83bbdd79b
196 changed files with 21425 additions and 15712 deletions

View File

@ -9,9 +9,9 @@
* Plugin Name: Advanced Custom Fields PRO
* Plugin URI: https://www.advancedcustomfields.com
* Description: Customize WordPress with powerful, professional and intuitive fields.
* Version: 6.0.3
* Version: 6.0.7
* Author: WP Engine
* Author URI: https://www.advancedcustomfields.com
* Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
* Update URI: https://www.advancedcustomfields.com/pro
* Text Domain: acf
* Domain Path: /lang
@ -33,7 +33,7 @@ if ( ! class_exists( 'ACF' ) ) {
*
* @var string
*/
public $version = '6.0.3';
public $version = '6.0.7';
/**
* The plugin settings array.

View File

@ -71,6 +71,7 @@
/* Field type */
/* table header */
/* show keys */
/* hide tabs */
/* fields */
}
#acf-field-group-fields .inside {
@ -123,6 +124,34 @@
#acf-field-group-fields.show-field-keys .li-field-type {
width: 25%;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-tab-bar {
display: none;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-main {
padding: 0;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-main.acf-field-settings-main-general {
padding-top: 32px;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-main .acf-field {
margin-bottom: 32px;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-main .acf-field-setting-wrapper {
padding-top: 0;
border-top: none;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-main .acf-field-settings-split .acf-field {
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #EAECF0;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-main .acf-field-setting-first_day {
padding-top: 0;
border-top: none;
}
#acf-field-group-fields.hide-tabs .acf-field-settings-footer {
margin-top: 32px;
}
#acf-field-group-fields .acf-field-list-wrap {
border: #ccd0d4 solid 1px;
}
@ -132,8 +161,8 @@
/* no fields */
/* empty */
}
#acf-field-group-fields .acf-field-list .li-field-name,
#acf-field-group-fields .acf-field-list .li-field-key {
#acf-field-group-fields .acf-field-list .acf-tbody > .li-field-name,
#acf-field-group-fields .acf-field-list .acf-tbody > .li-field-key {
align-items: flex-start;
}
#acf-field-group-fields .acf-field-list .copyable:not(.copy-unsupported) {
@ -525,8 +554,8 @@ html[dir=rtl] .acf-field-object.open > .handle {
*----------------------------------------------------------------------------*/
@media only screen and (max-width: 850px) {
tr.acf-field,
td.acf-label,
td.acf-input {
td.acf-label,
td.acf-input {
display: block !important;
width: auto !important;
border: 0 none !important;
@ -828,6 +857,11 @@ td.acf-input {
height: 20px;
background-color: red;
}
.post-type-acf-field-group.rtl select {
padding-right: 12px;
padding-left: 40px;
background-position: left 10px top 50%;
}
.post-type-acf-field-group input[type=radio],
.post-type-acf-field-group input[type=checkbox] {
box-sizing: border-box;
@ -876,6 +910,11 @@ td.acf-input {
background-color: #F9FAFB;
border-color: #D0D5DD;
}
.post-type-acf-field-group.rtl input[type=radio]:checked:before, .post-type-acf-field-group.rtl input[type=radio]:focus-visible:before,
.post-type-acf-field-group.rtl input[type=checkbox]:checked:before,
.post-type-acf-field-group.rtl input[type=checkbox]:focus-visible:before {
left: 1px;
}
.post-type-acf-field-group input[type=radio]:checked:before, .post-type-acf-field-group input[type=radio]:focus:before {
background-image: url("../../images/field-states/radio-active.svg");
}
@ -937,12 +976,13 @@ td.acf-input {
}
.post-type-acf-field-group .acf-field-true-false {
display: flex;
align-items: center;
align-items: flex-start;
}
.post-type-acf-field-group .acf-field-true-false .acf-label {
order: 2;
display: inline-flex;
display: block;
align-items: center;
margin-top: 2px;
margin-bottom: 0;
margin-left: 12px;
}
@ -952,6 +992,11 @@ td.acf-input {
.post-type-acf-field-group .acf-field-true-false .acf-label .acf-tip {
margin-left: 12px;
}
.post-type-acf-field-group .acf-field-true-false .acf-label .description {
display: block;
margin-top: 2px;
margin-left: 0;
}
.post-type-acf-field-group.rtl .acf-field-true-false .acf-label {
margin-right: 12px;
margin-left: 0;
@ -1097,6 +1142,9 @@ td.acf-input {
.post-type-acf-field-group .acf-label label {
margin-bottom: 0;
}
.post-type-acf-field-group .acf-label .description {
margin-top: 2px;
}
.post-type-acf-field-group .acf-field-setting-name .acf-tip {
position: absolute;
top: 0;
@ -1349,7 +1397,7 @@ td.acf-input {
*
*----------------------------------------------------------------------------*/
.acf-field-settings .acf-label {
display: flex;
display: block;
justify-content: space-between;
align-items: center;
align-content: center;
@ -1703,8 +1751,8 @@ td.acf-input {
text-indent: 500%;
white-space: nowrap;
overflow: hidden;
-webkit-mask-image: url("../../images/icons/icon-chevron-right.svg");
mask-image: url("../../images/icons/icon-chevron-right.svg");
-webkit-mask-image: url("../../images/icons/icon-chevron-down.svg");
mask-image: url("../../images/icons/icon-chevron-down.svg");
}
.acf-field-object .li-field-label:hover:before {
cursor: pointer;
@ -1717,8 +1765,8 @@ td.acf-input {
.rtl .acf-field-object .li-field-label:before {
left: 0;
right: 6px;
-webkit-mask-image: url("../../images/icons/icon-chevron-left.svg");
mask-image: url("../../images/icons/icon-chevron-left.svg");
-webkit-mask-image: url("../../images/icons/icon-chevron-down.svg");
mask-image: url("../../images/icons/icon-chevron-down.svg");
}
.rtl .acf-field-object.open .li-field-label:before {
-webkit-mask-image: url("../../images/icons/icon-chevron-down.svg");
@ -2073,7 +2121,7 @@ td.acf-input {
*----------------------------------------------------------------------------*/
.acf-field-setting-display_format .acf-label,
.acf-field-setting-return_format .acf-label {
margin-bottom: 16px;
margin-bottom: 6px;
}
.acf-field-setting-display_format .acf-radio-list li,
.acf-field-setting-return_format .acf-radio-list li {
@ -2240,7 +2288,38 @@ td.acf-input {
* Flexible content field
*
*---------------------------------------------------------------------------------------------*/
.post-type-acf-field-group i.acf-icon.-duplicate.duplicate-layout {
margin: 0 auto !important;
background-color: #667085;
color: #667085;
}
.post-type-acf-field-group i.acf-icon.acf-icon-trash.delete-layout {
margin: 0 auto !important;
background-color: #667085;
color: #667085;
}
.post-type-acf-field-group button.acf-btn.acf-btn-tertiary.acf-field-setting-fc-duplicate, .post-type-acf-field-group button.acf-btn.acf-btn-tertiary.acf-field-setting-fc-delete {
background-color: #ffffff !important;
box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.1);
border-radius: 6px;
width: 32px;
height: 32px !important;
min-height: 32px;
padding: 0;
}
.post-type-acf-field-group button.add-layout.acf-btn.acf-btn-primary.add-field,
.post-type-acf-field-group .acf-sub-field-list-header a.acf-btn.acf-btn-secondary.add-field,
.post-type-acf-field-group .acf-field-list-wrap.acf-is-subfields a.acf-btn.acf-btn-secondary.add-field {
height: 32px !important;
min-height: 32px;
margin-left: 5px;
}
.post-type-acf-field-group .acf-field.acf-field-setting-fc_layout {
background-color: #ffffff;
margin-bottom: 16px;
}
.post-type-acf-field-group .acf-field-setting-fc_layout {
overflow: hidden;
width: calc(100% - 144px);
margin-right: 72px;
margin-left: 72px;
@ -2252,6 +2331,12 @@ td.acf-input {
border-radius: 8px;
box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.1);
}
.post-type-acf-field-group .acf-field-setting-fc_layout .acf-field-layout-settings.open {
background-color: #ffffff;
border-top-width: 1px;
border-top-style: solid;
border-top-color: #EAECF0;
}
@media screen and (max-width: 768px) {
.post-type-acf-field-group .acf-field-setting-fc_layout {
width: calc(100% - 16px);
@ -2274,18 +2359,27 @@ td.acf-input {
margin-left: 32px;
}
.post-type-acf-field-group .acf-field-setting-fc_layout .acf-fc-meta {
max-width: 600px;
max-width: 100%;
padding-top: 24px;
padding-right: 32px;
padding-left: 32px;
}
.post-type-acf-field-group .acf-field-settings-fc_head {
background-color: #F9FAFB;
border-radius: 8px 8px 0px 0px;
display: flex;
min-height: 64px;
margin-bottom: 24px;
margin-bottom: 0px;
padding-right: 24px;
}
.post-type-acf-field-group .acf-field-settings-fc_head .acf-fc_draggable {
min-height: 64px;
padding-left: 24px;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #EAECF0;
display: flex;
}
.post-type-acf-field-group .acf-field-settings-fc_head span.toggle-indicator {
pointer-events: none;
margin-top: 7px;
}
.post-type-acf-field-group .acf-field-settings-fc_head label {
display: inline-flex;
@ -2307,11 +2401,22 @@ td.acf-input {
-webkit-mask-position: center;
mask-position: center;
}
.rtl.post-type-acf-field-group .acf-field-settings-fc_head label:before {
padding-right: 10px;
}
.post-type-acf-field-group .acf-field-settings-fc_head .acf-fl-actions {
display: flex;
align-items: center;
}
.post-type-acf-field-group .acf-field-settings-fc_head .acf-fl-actions .acf-fc-add-layout {
margin-left: 10px;
}
.post-type-acf-field-group .acf-field-settings-fc_head .acf-fl-actions .acf-fc-add-layout .add-field {
margin-left: 0px !important;
}
.post-type-acf-field-group .acf-field-settings-fc_head .acf-fl-actions li {
margin-right: 16px;
margin-right: 4px;
}
.post-type-acf-field-group .acf-field-settings-fc_head .acf-fl-actions li:last-of-type {
margin-right: 0;
@ -2323,8 +2428,8 @@ td.acf-input {
*
*---------------------------------------------------------------------------------------------*/
.post-type-acf-field-group .acf-field-object.open > .handle > .acf-tbody > .li-field-label::before {
-webkit-mask-image: url("../../images/icons/icon-chevron-down.svg");
mask-image: url("../../images/icons/icon-chevron-down.svg");
-webkit-mask-image: url("../../images/icons/icon-chevron-up.svg");
mask-image: url("../../images/icons/icon-chevron-up.svg");
}
/*---------------------------------------------------------------------------------------------

File diff suppressed because one or more lines are too long

View File

@ -454,6 +454,27 @@
border: solid 2px currentColor;
}
.acf-icon.-trash {
position: relative;
}
.acf-icon.-trash:before, .acf-icon.-trash:after {
content: "";
display: block;
box-sizing: border-box;
width: 46%;
height: 46%;
position: absolute;
top: 33%;
left: 23%;
}
.acf-icon.-trash:before {
margin: -1px 0 0 1px;
box-shadow: 2px -2px 0px 0px currentColor;
}
.acf-icon.-trash:after {
border: solid 2px currentColor;
}
.acf-icon.-collapse:before {
content: "\f142";
margin-left: -0.1em;
@ -944,7 +965,7 @@ html[dir=rtl] #acf-popup .acf-popup-box .title .acf-icon {
}
@media screen and (max-width: 640px) {
#acf-upgrade-notice .col-content,
#acf-upgrade-notice .col-actions {
#acf-upgrade-notice .col-actions {
float: none;
padding-left: 90px;
width: auto;
@ -1203,7 +1224,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
margin: 0;
}
.acf-postbox-columns .acf-postbox-main,
.acf-postbox-columns .acf-postbox-side {
.acf-postbox-columns .acf-postbox-side {
float: none;
width: auto;
margin: 0;
@ -1575,7 +1596,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
*---------------------------------------------------------------------------------------------*/
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2/1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {
.acf-loading,
.acf-spinner {
.acf-spinner {
background-image: url(../../images/spinner@2x.gif);
background-size: 20px 20px;
}
@ -2005,7 +2026,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
.post-type-acf-field-group .notice.notice-error:after,
.post-type-acf-field-group #lost-connection-notice:after {
background-color: #DA5A39;
background-color: #D13737;
}
/*---------------------------------------------------------------------------------------------
@ -2295,6 +2316,11 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
height: 20px;
background-color: red;
}
.post-type-acf-field-group.rtl select {
padding-right: 12px;
padding-left: 40px;
background-position: left 10px top 50%;
}
.post-type-acf-field-group input[type=radio],
.post-type-acf-field-group input[type=checkbox] {
box-sizing: border-box;
@ -2343,6 +2369,11 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
background-color: #F9FAFB;
border-color: #D0D5DD;
}
.post-type-acf-field-group.rtl input[type=radio]:checked:before, .post-type-acf-field-group.rtl input[type=radio]:focus-visible:before,
.post-type-acf-field-group.rtl input[type=checkbox]:checked:before,
.post-type-acf-field-group.rtl input[type=checkbox]:focus-visible:before {
left: 1px;
}
.post-type-acf-field-group input[type=radio]:checked:before, .post-type-acf-field-group input[type=radio]:focus:before {
background-image: url("../../images/field-states/radio-active.svg");
}
@ -2404,12 +2435,13 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
.post-type-acf-field-group .acf-field-true-false {
display: flex;
align-items: center;
align-items: flex-start;
}
.post-type-acf-field-group .acf-field-true-false .acf-label {
order: 2;
display: inline-flex;
display: block;
align-items: center;
margin-top: 2px;
margin-bottom: 0;
margin-left: 12px;
}
@ -2419,6 +2451,11 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
.post-type-acf-field-group .acf-field-true-false .acf-label .acf-tip {
margin-left: 12px;
}
.post-type-acf-field-group .acf-field-true-false .acf-label .description {
display: block;
margin-top: 2px;
margin-left: 0;
}
.post-type-acf-field-group.rtl .acf-field-true-false .acf-label {
margin-right: 12px;
margin-left: 0;
@ -2564,6 +2601,9 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
.post-type-acf-field-group .acf-label label {
margin-bottom: 0;
}
.post-type-acf-field-group .acf-label .description {
margin-top: 2px;
}
.post-type-acf-field-group .acf-field-setting-name .acf-tip {
position: absolute;
top: 0;
@ -2625,7 +2665,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
@media screen and (max-width: 880px) {
.acf-admin-field-groups .wp-list-table th.check-column,
.acf-admin-field-groups .wp-list-table td.check-column {
.acf-admin-field-groups .wp-list-table td.check-column {
vertical-align: top;
padding-right: 2px;
padding-left: 10px;
@ -2648,14 +2688,14 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
@media screen and (max-width: 880px) {
.acf-admin-field-groups .wp-list-table thead th, .acf-admin-field-groups .wp-list-table thead td,
.acf-admin-field-groups .wp-list-table tfoot th, .acf-admin-field-groups .wp-list-table tfoot td {
.acf-admin-field-groups .wp-list-table tfoot th, .acf-admin-field-groups .wp-list-table tfoot td {
padding-right: 16px;
padding-left: 8px;
}
}
@media screen and (max-width: 880px) {
.acf-admin-field-groups .wp-list-table thead th.check-column, .acf-admin-field-groups .wp-list-table thead td.check-column,
.acf-admin-field-groups .wp-list-table tfoot th.check-column, .acf-admin-field-groups .wp-list-table tfoot td.check-column {
.acf-admin-field-groups .wp-list-table tfoot th.check-column, .acf-admin-field-groups .wp-list-table tfoot td.check-column {
vertical-align: middle;
}
}
@ -2675,7 +2715,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
@media screen and (max-width: 880px) {
.acf-admin-field-groups .wp-list-table tbody th,
.acf-admin-field-groups .wp-list-table tbody td {
.acf-admin-field-groups .wp-list-table tbody td {
padding-right: 16px;
padding-left: 8px;
}
@ -3070,8 +3110,8 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
*---------------------------------------------------------------------------------------------*/
@media screen and (max-width: 880px) {
.post-type-acf-field-group .widefat th input[type=checkbox],
.post-type-acf-field-group .widefat thead td input[type=checkbox],
.post-type-acf-field-group .widefat tfoot td input[type=checkbox] {
.post-type-acf-field-group .widefat thead td input[type=checkbox],
.post-type-acf-field-group .widefat tfoot td input[type=checkbox] {
margin-bottom: 0;
}
}
@ -3277,13 +3317,26 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
flex-wrap: wrap;
}
.acf-headerbar .acf-headerbar-content .acf-headerbar-title,
.acf-headerbar .acf-headerbar-content .acf-title-wrap {
.acf-headerbar .acf-headerbar-content .acf-title-wrap {
flex: 1 1 100%;
}
.acf-headerbar .acf-headerbar-content .acf-title-wrap {
margin-top: 8px;
}
}
.acf-headerbar .acf-input-error {
border: 1px rgba(209, 55, 55, 0.5) solid !important;
box-shadow: 0px 0px 0px 3px rgba(209, 55, 55, 0.12), 0px 0px 0px rgba(255, 54, 54, 0.25) !important;
background-image: url("../../images/icons/icon-warning-alt-red.svg");
background-position: right 10px top 50%;
background-size: 20px;
background-repeat: no-repeat;
}
.acf-headerbar .acf-input-error:focus {
outline: none !important;
border: 1px rgba(209, 55, 55, 0.8) solid !important;
box-shadow: 0px 0px 0px 3px rgba(209, 55, 55, 0.16), 0px 0px 0px rgba(255, 54, 54, 0.25) !important;
}
.acf-headerbar .acf-headerbar-title-field {
min-width: 320px;
}
@ -3298,6 +3351,12 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
.acf-headerbar .acf-headerbar-actions .acf-btn {
margin-left: 8px;
}
.acf-headerbar .acf-headerbar-actions .disabled {
background-color: #F2F4F7;
color: #98A2B3 !important;
border: 1px #D0D5DD solid;
cursor: default;
}
/*---------------------------------------------------------------------------------------------
*
@ -3454,8 +3513,8 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
margin-left: 6px;
}
.rtl .acf-btn.acf-btn-sm i.acf-icon {
margin-right: 2px;
margin-left: -4px;
margin-right: -4px;
margin-left: 2px;
}
/*---------------------------------------------------------------------------------------------
@ -3464,9 +3523,9 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
*
*---------------------------------------------------------------------------------------------*/
.acf-btn.acf-delete-field-group:hover {
background-color: #fdf8f6;
border-color: #DA5A39 !important;
color: #DA5A39 !important;
background-color: #fbeded;
border-color: #D13737 !important;
color: #D13737 !important;
}
/*--------------------------------------------------------------------------------------------
@ -3504,6 +3563,29 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
*
*--------------------------------------------------------------------------------------------*/
}
.post-type-acf-field-group i.acf-field-setting-fc-delete, .post-type-acf-field-group i.acf-field-setting-fc-duplicate {
box-sizing: border-box;
/* Auto layout */
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 8px;
cursor: pointer;
width: 32px;
height: 32px;
/* Base / White */
background: #FFFFFF;
/* Gray/300 */
border: 1px solid #D0D5DD;
/* Elevation/01 */
box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.1);
border-radius: 6px;
/* Inside auto layout */
flex: none;
order: 0;
flex-grow: 0;
}
.post-type-acf-field-group i.acf-icon-plus {
-webkit-mask-image: url("../../images/icons/icon-add.svg");
mask-image: url("../../images/icons/icon-add.svg");
@ -3520,10 +3602,17 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
-webkit-mask-image: url("../../images/icons/icon-key.svg");
mask-image: url("../../images/icons/icon-key.svg");
}
.post-type-acf-field-group i.acf-icon-trash {
.post-type-acf-field-group i.acf-icon-trash, .post-type-acf-field-group button.acf-icon-trash {
-webkit-mask-image: url("../../images/icons/icon-trash.svg");
mask-image: url("../../images/icons/icon-trash.svg");
}
.post-type-acf-field-group i.acf-icon.-duplicate, .post-type-acf-field-group button.acf-icon-duplicate {
-webkit-mask-image: url("../../images/field-type-icons/icon-field-clone.svg");
mask-image: url("../../images/field-type-icons/icon-field-clone.svg");
}
.post-type-acf-field-group i.acf-icon.-duplicate:before, .post-type-acf-field-group i.acf-icon.-duplicate:after, .post-type-acf-field-group button.acf-icon-duplicate:before, .post-type-acf-field-group button.acf-icon-duplicate:after {
content: none;
}
.post-type-acf-field-group i.acf-icon-arrow-right {
-webkit-mask-image: url("../../images/icons/icon-arrow-right.svg");
mask-image: url("../../images/icons/icon-arrow-right.svg");
@ -3556,6 +3645,14 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
-webkit-mask-image: url("../../images/field-type-icons/icon-field-image.svg");
mask-image: url("../../images/field-type-icons/icon-field-image.svg");
}
.post-type-acf-field-group i.acf-icon-warning {
-webkit-mask-image: url("../../images/icons/icon-warning-alt.svg");
mask-image: url("../../images/icons/icon-warning-alt.svg");
}
.post-type-acf-field-group i.acf-icon-warning-red {
-webkit-mask-image: url("../../images/icons/icon-warning-alt-red.svg");
mask-image: url("../../images/icons/icon-warning-alt-red.svg");
}
.post-type-acf-field-group .post-type-acf-field-group .post-state {
font-weight: normal;
}
@ -3649,15 +3746,29 @@ h3.acf-sub-field-list-title:before {
mask-image: url("../../images/icons/icon-layout.svg");
}
.acf-field-setting-fc_layout .acf-field-settings-fc_head:hover .reorder-layout:before {
width: 20px;
height: 11px;
background-color: #475467 !important;
-webkit-mask-image: url("../../images/icons/icon-draggable.svg");
mask-image: url("../../images/icons/icon-draggable.svg");
}
/*--------------------------------------------------------------------------------------------
*
* Postbox expand / collapse icon
*
*--------------------------------------------------------------------------------------------*/
.post-type-acf-field-group .postbox-header .handle-actions {
.post-type-acf-field-group .postbox-header .handle-actions,
.post-type-acf-field-group #acf-field-group-fields .postbox-header .handle-actions,
.post-type-acf-field-group #acf-field-group-options .postbox-header .handle-actions,
.post-type-acf-field-group .postbox .postbox-header .handle-actions {
display: flex;
}
.post-type-acf-field-group .postbox-header .handle-actions .toggle-indicator:before {
.post-type-acf-field-group .postbox-header .handle-actions .toggle-indicator:before,
.post-type-acf-field-group #acf-field-group-fields .postbox-header .handle-actions .toggle-indicator:before,
.post-type-acf-field-group #acf-field-group-options .postbox-header .handle-actions .toggle-indicator:before,
.post-type-acf-field-group .postbox .postbox-header .handle-actions .toggle-indicator:before {
content: "";
display: inline-flex;
width: 20px;
@ -3674,7 +3785,10 @@ h3.acf-sub-field-list-title:before {
-webkit-mask-image: url("../../images/icons/icon-chevron-up.svg");
mask-image: url("../../images/icons/icon-chevron-up.svg");
}
.post-type-acf-field-group.closed .postbox-header .handle-actions .toggle-indicator:before {
.post-type-acf-field-group.closed .postbox-header .handle-actions .toggle-indicator:before,
.post-type-acf-field-group #acf-field-group-fields.closed .postbox-header .handle-actions .toggle-indicator:before,
.post-type-acf-field-group #acf-field-group-options.closed .postbox-header .handle-actions .toggle-indicator:before,
.post-type-acf-field-group .postbox.closed .postbox-header .handle-actions .toggle-indicator:before {
-webkit-mask-image: url("../../images/icons/icon-chevron-down.svg");
mask-image: url("../../images/icons/icon-chevron-down.svg");
}
@ -4306,7 +4420,7 @@ h3.acf-sub-field-list-title:before {
align-items: flex-start;
}
#acf-field-group-pro-features .acf-field-group-pro-features-wrapper .acf-field-group-pro-features-content,
#acf-field-group-pro-features .acf-field-group-pro-features-wrapper .acf-field-group-pro-features-actions {
#acf-field-group-pro-features .acf-field-group-pro-features-wrapper .acf-field-group-pro-features-actions {
flex: 0 1 100%;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -835,7 +835,7 @@ html[dir=rtl] .select2-container.-acf .select2-choice .select2-arrow {
white-space: normal;
}
.select2-dropdown {
.acf-admin-single-field-group .select2-dropdown {
border-color: #6BB5D8 !important;
margin-top: -5px;
overflow: hidden;
@ -846,15 +846,15 @@ html[dir=rtl] .select2-container.-acf .select2-choice .select2-arrow {
margin-top: 0;
}
.select2-container--default .select2-results__option[aria-selected=true] {
.acf-admin-single-field-group .select2-container--default .select2-results__option[aria-selected=true] {
background-color: #F9FAFB !important;
color: #667085;
}
.select2-container--default .select2-results__option[aria-selected=true]:hover {
.acf-admin-single-field-group .select2-container--default .select2-results__option[aria-selected=true]:hover {
color: #399CCB;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
.acf-admin-single-field-group .select2-container--default .select2-results__option--highlighted[aria-selected] {
color: #fff !important;
background-color: #0783BE !important;
}
@ -2880,7 +2880,7 @@ p.submit .acf-spinner {
/* field */
}
.media-modal .setting span,
.media-modal .compat-attachment-fields > tbody > .acf-field > .acf-label {
.media-modal .compat-attachment-fields > tbody > .acf-field > .acf-label {
width: 98%;
float: none;
text-align: left;
@ -2888,8 +2888,8 @@ p.submit .acf-spinner {
padding: 0;
}
.media-modal .setting input,
.media-modal .setting textarea,
.media-modal .compat-attachment-fields > tbody > .acf-field > .acf-input {
.media-modal .setting textarea,
.media-modal .compat-attachment-fields > tbody > .acf-field > .acf-input {
float: none;
height: auto;
max-width: none;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -25,6 +25,57 @@
* Flexible Content
*
*---------------------------------------------------------------------------------------------*/
.acf-field-setting-fc_layout .acf-toggle-fc-layout {
width: 34px;
height: 31px;
margin: 0;
padding: 0;
border: 0;
background: transparent;
cursor: pointer;
left: 20.83%;
right: 20.83%;
top: 33.33%;
bottom: 33.33%;
}
.acf-field-setting-fc_layout .toggle-indicator::before {
z-index: -1;
content: "";
display: inline-flex;
width: 20px;
height: 20px;
margin-left: -28px;
background-color: currentColor;
border: none;
border-radius: 0;
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-position: center;
mask-position: center;
-webkit-mask-image: url(../../../images/icons/icon-chevron-down.svg);
mask-image: url(../../../images/icons/icon-chevron-down.svg);
}
.rtl .acf-field-setting-fc_layout .toggle-indicator::before {
margin-left: 0px;
position: absolute;
top: 9px;
z-index: 100;
left: 8px;
}
.acf-field-setting-fc_layout .toggle-indicator.open::before {
-webkit-mask-image: url(../../../images/icons/icon-chevron-up.svg);
mask-image: url(../../../images/icons/icon-chevron-up.svg);
}
.acf-field-setting-fc_layout .toggle-indicator.closed::before {
-webkit-mask-image: url(../../../images/icons/icon-chevron-down.svg);
mask-image: url(../../../images/icons/icon-chevron-down.svg);
}
.acf-field-setting-fc_layout .acf-flexible-content-field-label-name {
padding-left: 5px;
}
.acf-field-setting-fc_layout .acf-fc-meta {
margin: 0 0 10px;
padding: 0;
@ -36,38 +87,43 @@
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display {
float: left;
width: 100%;
padding-right: 10px;
padding-right: 5px;
}
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min {
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-left {
width: calc(50% - 4px);
float: left;
clear: left;
margin-right: 4px;
}
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-max {
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-right {
width: calc(50% - 4px);
float: left;
margin-left: 4px;
}
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min {
width: calc(25% - 5px);
float: left;
margin-right: 5px;
}
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-max {
width: calc(25% - 10px);
float: left;
margin-left: 4px;
}
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-label .acf-input-prepend,
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-name .acf-input-prepend,
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display .acf-input-prepend {
min-width: 60px;
}
.acf-field-setting-fc_layout .acf-fl-actions {
visibility: hidden;
}
.acf-field-setting-fc_layout .acf-fl-actions .reorder-layout {
cursor: move;
.acf-field-setting-fc_layout .acf-fc_draggable,
.acf-field-setting-fc_layout .reorder-layout {
cursor: grab;
}
.acf-field-setting-fc_layout .acf-fl-actions a {
padding: 1px 0;
font-size: 13px;
line-height: 20px;
}
.acf-field-setting-fc_layout:hover .acf-fl-actions, .acf-field-setting-fc_layout.-hover .acf-fl-actions {
visibility: visible;
}
/*---------------------------------------------------------------------------------------------
*

View File

@ -1 +1 @@
.acf-field-setting-fc_layout .acf-fc-meta{margin:0 0 10px;padding:0}.acf-field-setting-fc_layout .acf-fc-meta li{margin:0 0 10px;padding:0}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display{float:left;width:100%;padding-right:10px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min{width:calc(50% - 4px);float:left;clear:left;margin-right:4px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-max{width:calc(50% - 4px);float:left;margin-left:4px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-label .acf-input-prepend,.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-name .acf-input-prepend,.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display .acf-input-prepend{min-width:60px}.acf-field-setting-fc_layout .acf-fl-actions{visibility:hidden}.acf-field-setting-fc_layout .acf-fl-actions .reorder-layout{cursor:move}.acf-field-setting-fc_layout .acf-fl-actions a{padding:1px 0;font-size:13px;line-height:20px}.acf-field-setting-fc_layout:hover .acf-fl-actions,.acf-field-setting-fc_layout.-hover .acf-fl-actions{visibility:visible}.acf-field-object-clone[data-display=seamless] .acf-field-setting-instructions,.acf-field-object-clone[data-display=seamless] .acf-field-setting-layout,.acf-field-object-clone[data-display=seamless] .acf-field-setting-wrapper,.acf-field-object-clone[data-display=seamless] .acf-field-setting-conditional_logic{display:none}
.acf-field-setting-fc_layout .acf-toggle-fc-layout{width:34px;height:31px;margin:0;padding:0;border:0;background:rgba(0,0,0,0);cursor:pointer;left:20.83%;right:20.83%;top:33.33%;bottom:33.33%}.acf-field-setting-fc_layout .toggle-indicator::before{z-index:-1;content:"";display:inline-flex;width:20px;height:20px;margin-left:-28px;background-color:currentColor;border:none;border-radius:0;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;-webkit-mask-image:url(../../../images/icons/icon-chevron-down.svg);mask-image:url(../../../images/icons/icon-chevron-down.svg)}.rtl .acf-field-setting-fc_layout .toggle-indicator::before{margin-left:0px;position:absolute;top:9px;z-index:100;left:8px}.acf-field-setting-fc_layout .toggle-indicator.open::before{-webkit-mask-image:url(../../../images/icons/icon-chevron-up.svg);mask-image:url(../../../images/icons/icon-chevron-up.svg)}.acf-field-setting-fc_layout .toggle-indicator.closed::before{-webkit-mask-image:url(../../../images/icons/icon-chevron-down.svg);mask-image:url(../../../images/icons/icon-chevron-down.svg)}.acf-field-setting-fc_layout .acf-flexible-content-field-label-name{padding-left:5px}.acf-field-setting-fc_layout .acf-fc-meta{margin:0 0 10px;padding:0}.acf-field-setting-fc_layout .acf-fc-meta li{margin:0 0 10px;padding:0}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display{float:left;width:100%;padding-right:5px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-left{width:calc(50% - 4px);float:left;clear:left;margin-right:4px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-right{width:calc(50% - 4px);float:left;margin-left:4px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min{width:calc(25% - 5px);float:left;margin-right:5px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-max{width:calc(25% - 10px);float:left;margin-left:4px}.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-label .acf-input-prepend,.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-name .acf-input-prepend,.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display .acf-input-prepend{min-width:60px}.acf-field-setting-fc_layout .acf-fc_draggable,.acf-field-setting-fc_layout .reorder-layout{cursor:grab}.acf-field-setting-fc_layout .acf-fl-actions a{padding:1px 0;font-size:13px;line-height:20px}.acf-field-object-clone[data-display=seamless] .acf-field-setting-instructions,.acf-field-object-clone[data-display=seamless] .acf-field-setting-layout,.acf-field-object-clone[data-display=seamless] .acf-field-setting-wrapper,.acf-field-object-clone[data-display=seamless] .acf-field-setting-conditional_logic{display:none}

View File

@ -50,8 +50,8 @@
margin: 0 0 8px;
background: #F9F9F9;
}
.acf-repeater .acf-divider td {
border-top: 10px solid #e4e4e4;
.acf-repeater > table > tbody tr.acf-divider:not(:first-child) > td {
border-top: 10px solid #EAECF0;
}
.acf-repeater .acf-row-handle {
width: 16px;
@ -177,6 +177,7 @@ body.acf-keydown-shift .acf-repeater .acf-row:hover > .acf-row-handle .acf-icon.
}
.acf-repeater .acf-actions .acf-button {
float: right;
pointer-events: auto !important;
}
.acf-repeater .acf-actions .acf-tablenav {
float: right;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,11 +1,11 @@
/******/ (function() { // webpackBootstrap
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-clone.js":
/*!********************************************************************************!*\
!*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-clone.js ***!
\********************************************************************************/
/***/ (function() {
/***/ (() => {
(function ($) {
/**
@ -19,17 +19,20 @@
* @param void
* @return void
*/
var CloneDisplayFieldSetting = acf.FieldSetting.extend({
type: 'clone',
name: 'display',
render: function () {
// vars
var display = this.field.val(); // set data attribute used by CSS to hide/show
var display = this.field.val();
// set data attribute used by CSS to hide/show
this.$fieldObject.attr('data-display', display);
}
});
acf.registerFieldSetting(CloneDisplayFieldSetting);
/**
* ClonePrefixLabelFieldSetting
*
@ -47,17 +50,19 @@
name: 'prefix_label',
render: function () {
// vars
var prefix = ''; // if checked
var prefix = '';
// if checked
if (this.field.val()) {
prefix = this.fieldObject.prop('label') + ' ';
} // update HTML
}
// update HTML
this.$('code').html(prefix + '%field_label%');
}
});
acf.registerFieldSetting(ClonePrefixLabelFieldSetting);
/**
* ClonePrefixNameFieldSetting
*
@ -75,17 +80,19 @@
name: 'prefix_name',
render: function () {
// vars
var prefix = ''; // if checked
var prefix = '';
// if checked
if (this.field.val()) {
prefix = this.fieldObject.prop('name') + '_';
} // update HTML
}
// update HTML
this.$('code').html(prefix + '%field_name%');
}
});
acf.registerFieldSetting(ClonePrefixNameFieldSetting);
/**
* cloneFieldSelectHelper
*
@ -106,18 +113,20 @@
// check
if (data.ajaxAction == 'acf/fields/clone/query') {
// remain open on select
options.closeOnSelect = false; // customize ajaxData function
options.closeOnSelect = false;
// customize ajaxData function
instance.data.ajaxData = this.ajaxData;
} // return
}
// return
return options;
},
ajaxData: function (data) {
// find current fields
data.fields = {}; // loop
data.fields = {};
// loop
acf.getFieldObjects().map(function (fieldObject) {
// append
data.fields[fieldObject.prop('key')] = {
@ -126,10 +135,12 @@
label: fieldObject.prop('label'),
ancestors: fieldObject.getParents().length
};
}); // append title
});
data.title = $('#title').val(); // return
// append title
data.title = $('#title').val();
// return
return data;
}
});
@ -141,7 +152,7 @@
/*!*******************************************************************************************!*\
!*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-flexible-content.js ***!
\*******************************************************************************************/
/***/ (function() {
/***/ (() => {
(function ($) {
/**
@ -155,14 +166,17 @@
* @param void
* @return void
*/
var FlexibleContentLayoutFieldSetting = acf.FieldSetting.extend({
type: 'flexible_content',
name: 'fc_layout',
events: {
'blur .layout-label': 'onChangeLabel',
'click .add-layout': 'onClickAdd',
'click .duplicate-layout': 'onClickDuplicate',
'click .delete-layout': 'onClickDelete'
'click .acf-field-settings-fc_head': 'onClickEdit',
'click .acf-field-setting-fc-duplicate': 'onClickDuplicate',
'click .acf-field-setting-fc-delete': 'onClickDelete',
'changed:layoutLabel': 'updateLayoutTitles'
},
$input: function (name) {
return $('#' + this.getInputId() + '-' + name);
@ -188,11 +202,10 @@
initialize: function () {
// add sortable
var $tbody = this.$el.parent();
if (!$tbody.hasClass('ui-sortable')) {
$tbody.sortable({
items: '> .acf-field-setting-fc_layout',
handle: '.reorder-layout',
handle: '.acf-fc_draggable',
forceHelperSize: true,
forcePlaceholderSize: true,
scroll: true,
@ -200,10 +213,11 @@
this.fieldObject.save();
})
});
} // add meta to sub fields
}
// add meta to sub fields
this.updateFieldLayouts();
this.updateLayoutTitles();
},
updateFieldLayouts: function () {
this.getChildren().map(this.updateFieldLayout, this);
@ -211,87 +225,161 @@
updateFieldLayout: function (field) {
field.prop('parent_layout', this.get('id'));
},
onChangeLabel: function (e, $el) {
// vars
var label = $el.val();
var $name = this.$input('name'); // render name
updateLayoutTitles: function () {
const label = this.get('layoutLabel');
const parentLabel = this.$el.find('> .acf-label .acf-fc-layout-name');
if (label) {
parentLabel.html(label);
}
},
onClickEdit: function (e) {
const $target = $(e.target);
if ($target.hasClass('acf-btn') || $target.parent().hasClass('acf-btn')) {
return;
}
this.isOpen() ? this.close() : this.open();
},
isOpen: function (e) {
const $settings = this.$el.children('.acf-field-layout-settings');
return $settings.hasClass('open');
},
open: function (element, isAddingLayout) {
const $settings = element ? element.children('.acf-field-layout-settings') : this.$el.children('.acf-field-layout-settings');
const toggle = element ? element.find('.toggle-indicator').first() : this.$el.find('.toggle-indicator').first();
// action (show)
acf.doAction('show', $settings);
// open
if (isAddingLayout) {
$settings.slideDown({
complete: function () {
$settings.find('.layout-label').trigger('focus');
}
});
} else {
$settings.slideDown();
}
toggle.addClass('open');
if (toggle.hasClass('closed')) {
toggle.removeClass('closed');
}
$settings.addClass('open');
},
close: function () {
const $settings = this.$el.children('.acf-field-layout-settings');
const toggle = this.$el.find('.toggle-indicator').first();
// close
$settings.slideUp();
$settings.removeClass('open');
toggle.removeClass('open');
if (!toggle.hasClass('closed')) {
toggle.addClass('closed');
}
// action (hide)
acf.doAction('hide', $settings);
},
onChangeLabel: function (e, $el) {
var label = $el.val();
this.set('layoutLabel', label);
this.$el.attr('data-layout-label', label);
var $name = this.$input('name');
// render name
if ($name.val() == '') {
acf.val($name, acf.strSanitize(label));
}
},
onClickAdd: function (e, $el) {
// vars
e.preventDefault();
var prevKey = this.get('id');
var newKey = acf.uniqid('layout_'); // duplicate
var newKey = acf.uniqid('layout_');
// duplicate
$layout = acf.duplicate({
$el: this.$el,
search: prevKey,
replace: newKey,
after: function ($el, $el2) {
// vars
var $list = $el2.find('.acf-field-list:first'); // remove sub fields
var $list = $el2.find('.acf-field-list:first');
$list.children('.acf-field-object').remove(); // show empty
// remove sub fields
$list.children('.acf-field-object').remove();
$list.addClass('-empty'); // reset layout meta values
// show empty
$list.addClass('-empty');
// reset layout meta values
$el2.attr('data-layout-label', '');
$el2.find('.acf-fc-meta input').val('');
$el2.find('.acf-fc-layout-name').html(acf.__('Layout'));
}
}); // get layout
});
var layout = acf.getFieldSetting($layout); // update hidden input
// get layout
var layout = acf.getFieldSetting($layout);
layout.$input('key').val(newKey); // save
// update hidden input
layout.$input('key').val(newKey);
!this.isOpen() ? this.open(layout.$el, true) : layout.$el.find('.layout-label').trigger('focus');
// save
this.fieldObject.save();
},
onClickDuplicate: function (e, $el) {
// vars
e.preventDefault();
var prevKey = this.get('id');
var newKey = acf.uniqid('layout_'); // duplicate
var newKey = acf.uniqid('layout_');
// duplicate
$layout = acf.duplicate({
$el: this.$el,
search: prevKey,
replace: newKey
}); // get all fields in new layout similar to fieldManager.onDuplicateField().
});
// get all fields in new layout similar to fieldManager.onDuplicateField().
// important to run field.wipe() before making any changes to the "parent_layout" prop
// to ensure the correct input is modified.
var children = acf.getFieldObjects({
parent: $layout
});
if (children.length) {
// loop
children.map(function (child) {
// wipe field
child.wipe(); // update parent
child.wipe();
// update parent
child.updateParent();
}); // action
});
// action
acf.doAction('duplicate_field_objects', children, this.fieldObject, this.fieldObject);
} // get layout
}
// get layout
var layout = acf.getFieldSetting($layout);
var layout = acf.getFieldSetting($layout); // update hidden input
layout.$input('key').val(newKey); // save
// update hidden input
layout.$input('key').val(newKey);
!this.isOpen() ? this.open(layout.$el, true) : layout.$el.find('.layout-label').trigger('focus');
// save
this.fieldObject.save();
},
onClickDelete: function (e, $el) {
e.preventDefault();
// Bypass confirmation when holding down "shift" key.
if (e.shiftKey) {
return this.delete();
} // add class
}
// add class
this.$el.addClass('-hover');
this.$el.addClass('-hover'); // add tooltip
// add tooltip
var tooltip = acf.newTooltip({
confirmRemove: true,
target: $el,
@ -305,27 +393,30 @@
});
},
delete: function () {
// vars
var $siblings = this.$el.siblings('.acf-field-setting-fc_layout'); // validate
var $siblings = this.$el.siblings('.acf-field-setting-fc_layout');
// validate
if (!$siblings.length) {
alert(acf.__('Flexible Content requires at least 1 layout'));
return false;
} // delete sub fields
}
// delete sub fields
this.getFields().map(function (child) {
child.delete({
animate: false
});
}); // remove tr
});
acf.remove(this.$el); // save
// remove tr
acf.remove(this.$el);
// save
this.fieldObject.save();
}
});
acf.registerFieldSetting(FlexibleContentLayoutFieldSetting);
/**
* flexibleContentHelper
*
@ -344,24 +435,25 @@
change_field_object_parent: 'updateParentLayout'
},
updateParentLayout: function (fieldObject) {
// vars
var parent = fieldObject.getParent(); // delete meta
var parent = fieldObject.getParent();
// delete meta
if (!parent || parent.prop('type') !== 'flexible_content') {
fieldObject.prop('parent_layout', null);
return;
} // get layout
}
// get layout
var $layout = fieldObject.$el.closest('.acf-field-setting-fc_layout');
var layout = acf.getFieldSetting($layout); // check if previous prop exists
// - if not, set prop to allow following code to trigger 'change' and save the field
var layout = acf.getFieldSetting($layout);
// check if previous prop exists
// - if not, set prop to allow following code to trigger 'change' and save the field
if (!fieldObject.has('parent_layout')) {
fieldObject.prop('parent_layout', 0);
} // update meta
}
// update meta
fieldObject.prop('parent_layout', layout.get('id'));
}
});
@ -373,7 +465,7 @@
/*!***********************************************************************************!*\
!*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-repeater.js ***!
\***********************************************************************************/
/***/ (function() {
/***/ (() => {
(function ($) {
/*
@ -388,6 +480,7 @@
* @param n/a
* @return n/a
*/
var RepeaterCollapsedFieldSetting = acf.FieldSetting.extend({
type: 'repeater',
name: 'collapsed',
@ -396,27 +489,32 @@
},
onFocus: function (e, $el) {
// vars
var $select = $el; // collapsed
var $select = $el;
var choices = []; // keep 'null' choice
// collapsed
var choices = [];
// keep 'null' choice
choices.push({
label: $select.find('option[value=""]').text(),
value: ''
}); // find sub fields
});
// find sub fields
var $list = this.fieldObject.$('.acf-field-list:first');
var fields = acf.getFieldObjects({
list: $list
}); // loop
});
// loop
fields.map(function (field) {
choices.push({
label: field.prop('label'),
value: field.prop('key')
});
}); // render
});
// render
acf.renderSelect($select, choices);
}
});
@ -453,49 +551,49 @@
/******/
/************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ !function() {
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ __webpack_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ function() { return module['default']; } :
/******/ function() { return module; };
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __webpack_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ }();
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ !function() {
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = function(exports, definition) {
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ }();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ !function() {
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ }();
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ !function() {
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ }();
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
!function() {
(() => {
"use strict";
/*!*********************************************************************************!*\
!*** ./src/advanced-custom-fields-pro/assets/src/js/pro/acf-pro-field-group.js ***!
@ -510,7 +608,8 @@ __webpack_require__.r(__webpack_exports__);
}();
})();
/******/ })()
;
//# sourceMappingURL=acf-pro-field-group.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.0539 9.38846V13.2977C11.0539 13.8352 11.4839 14.275 12.0312 14.275C12.5687 14.275 13.0085 13.8352 13.0085 13.2977V9.37869C13.0085 8.8314 12.5687 8.40138 12.0312 8.40138C11.4839 8.40138 11.0539 8.8314 11.0539 9.37869V9.38846ZM12.0312 18.1843H12.041C12.5785 18.1843 13.0183 17.7445 13.0183 17.2069C13.0183 16.6597 12.5785 16.2296 12.041 16.2296H12.0312C11.4839 16.2296 11.0539 16.6597 11.0539 17.2069C11.0539 17.7445 11.4839 18.1843 12.0312 18.1843ZM9.82247 3.90575L1.7792 17.7836C1.06577 19.0052 0.948491 19.2495 1.0169 19.8457C1.06577 20.393 1.35896 20.8914 1.80852 21.2237C2.28741 21.5657 2.55128 21.5951 3.96838 21.5951H20.0354C21.4427 21.5951 21.7163 21.5657 22.1952 21.2139C22.635 20.8816 22.9282 20.3832 22.9868 19.8261C23.0455 19.23 22.9282 18.9856 22.2245 17.7542L14.1813 3.86666C13.4678 2.64502 13.3115 2.42024 12.7739 2.17592C12.2657 1.94136 11.6891 1.94136 11.1809 2.17592C10.6336 2.41047 10.4773 2.63525 9.7736 3.85689L9.82247 3.90575ZM11.5132 4.88306C11.9139 4.1794 12.0507 3.98394 12.0116 4.00349C12.0116 3.99371 12.0116 3.99371 12.0116 3.99371C11.9725 3.97417 12.1094 4.16963 12.5101 4.86352L20.5436 18.7413C20.9443 19.4352 21.042 19.6502 21.0518 19.6209C21.0518 19.6111 21.042 19.6111 21.042 19.6209C21.0713 19.5916 20.827 19.6111 20.0158 19.6111H3.93906C3.12789 19.6111 2.88356 19.5818 2.91288 19.6111C2.90311 19.6014 2.90311 19.6014 2.90311 19.6014C2.90311 19.6307 3.00084 19.4157 3.41131 18.712L11.4448 4.82443L11.5132 4.88306Z" fill="#D13737"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.99 8.99v4c0 .55.44 1 1 1 .55 0 1-.45 1-1V8.98c0-.56-.45-1-1-1 -.56 0-1 .44-1 1Zm1 9H12c.55 0 1-.45 1-1 0-.56-.45-1-1-1h-.01c-.56 0-1 .44-1 1 0 .55.44 1 1 1ZM9.73 3.38L1.5 17.58c-.73 1.25-.85 1.5-.78 2.11 .05.56.35 1.07.81 1.41 .49.35.76.38 2.21.38h16.44c1.44 0 1.72-.03 2.21-.39 .45-.34.75-.85.81-1.42 .06-.61-.06-.86-.78-2.12L14.19 3.34c-.73-1.25-.89-1.48-1.44-1.73 -.52-.24-1.11-.24-1.63 0 -.56.24-.72.47-1.44 1.72Zm1.73 1c.41-.72.55-.92.51-.9 0-.01 0-.01 0-.01 -.04-.02.1.18.51.89l8.22 14.2c.41.71.51.93.52.9 0-.01-.01-.01-.01 0 .03-.03-.22-.01-1.05-.01H3.71c-.83 0-1.08-.03-1.05 0 -.01-.01-.01-.01-.01-.01 0 .03.1-.19.52-.91l8.22-14.21Z"/></svg>

After

Width:  |  Height:  |  Size: 722 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

View File

View File

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 525 B

View File

Before

Width:  |  Height:  |  Size: 653 B

After

Width:  |  Height:  |  Size: 653 B

View File

View File

View File

@ -746,7 +746,7 @@ function acf_render_field_wrap( $field, $element = 'div', $instruction = 'label'
if ( $element !== 'td' ) {
echo "<$inner_element class=\"acf-label\">" . "\n";
acf_render_field_label( $field );
if ( $instruction == 'label' && ! ( $field_setting && 'name' === $field['_name'] ) ) {
if ( $instruction == 'label' ) {
acf_render_field_instructions( $field, $field_setting );
}
echo "</$inner_element>" . "\n";
@ -758,10 +758,6 @@ function acf_render_field_wrap( $field, $element = 'div', $instruction = 'label'
}
echo "</$inner_element>" . "\n";
if ( 'name' === $field['_name'] && $field_setting ) {
acf_render_field_instructions( $field, $field_setting );
}
if ( $field_setting && $instruction == 'field' ) {
acf_render_field_instructions( $field );
}
@ -950,10 +946,15 @@ function acf_render_field_setting( $field, $setting, $global = false ) {
}
// If we're using a hint, set the label location as field so it appears after.
$label_location = ! empty( $setting['instructions'] ) ? 'label' : 'field';
$label_location = ! empty( $setting['instructions'] ) ? 'field' : 'label';
// If we're a true false field, force label location to label.
if ( $setting['type'] === 'true_false' ) {
$label_location = 'label';
}
// Render setting.
acf_render_field_wrap( $setting, 'div', $label_location, true );
acf_render_field_wrap( $setting, 'div', $label_location );
}
/**

View File

@ -161,9 +161,8 @@ function acf_save_post( $post_id = 0, $values = null ) {
function _acf_do_save_post( $post_id = 0 ) {
// phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
// Check and update $_POST data.
if ( $_POST['acf'] ) {
acf_update_values( $_POST['acf'], $post_id );
if ( ! empty( $_POST['acf'] ) ) {
acf_update_values( $_POST['acf'], $post_id ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by WP when saved.
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
}

View File

@ -119,7 +119,7 @@ function acf_cache_key( $key = '' ) {
*/
function acf_request_args( $args = array() ) {
foreach ( $args as $k => $v ) {
$args[ $k ] = isset( $_REQUEST[ $k ] ) ? $_REQUEST[ $k ] : $args[ $k ]; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Verified elsewhere.
$args[ $k ] = isset( $_REQUEST[ $k ] ) ? acf_sanitize_request_args( $_REQUEST[ $k ] ) : $args[ $k ]; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Verified elsewhere.
}
return $args;
}
@ -135,7 +135,7 @@ function acf_request_args( $args = array() ) {
* @return mixed
*/
function acf_request_arg( $name = '', $default = null ) {
return isset( $_REQUEST[ $name ] ) ? $_REQUEST[ $name ] : $default; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
return isset( $_REQUEST[ $name ] ) ? acf_sanitize_request_args( $_REQUEST[ $name ] ) : $default; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
}
// Register store.
@ -495,7 +495,7 @@ function acf_doing_action( $action ) {
function acf_get_current_url() {
// Ensure props exist to avoid PHP Notice during CLI commands.
if ( isset( $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'] ) ) {
return ( is_ssl() ? 'https' : 'http' ) . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
return ( is_ssl() ? 'https' : 'http' ) . '://' . filter_var( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL );
}
return '';
}
@ -518,7 +518,7 @@ function acf_add_url_utm_tags( $url, $campaign, $content, $anchor = false ) {
array(
'utm_source' => ( defined( 'ACF_PRO' ) && ACF_PRO ) ? 'ACF PRO' : 'ACF Free',
'utm_medium' => 'insideplugin',
'utm_campagin' => $campaign,
'utm_campaign' => $campaign,
'utm_content' => $content,
)
)
@ -528,3 +528,108 @@ function acf_add_url_utm_tags( $url, $campaign, $content, $anchor = false ) {
}
return esc_url( $url . $query . $anchor_url );
}
/**
* Sanitizes request arguments.
*
* @param mixed $args The data to sanitize.
*
* @return array|bool|float|int|mixed|string
*/
function acf_sanitize_request_args( $args = array() ) {
switch ( gettype( $args ) ) {
case 'boolean':
return (bool) $args;
case 'integer':
return (int) $args;
case 'double':
return (float) $args;
case 'array':
$sanitized = [];
foreach ( $args as $key => $value ) {
$key = sanitize_text_field( $key );
$sanitized[ $key ] = acf_sanitize_request_args( $value );
}
return $sanitized;
case 'object':
return wp_kses_post_deep( $args );
case 'string':
default:
return wp_kses( $args, 'acf' );
}
}
/**
* Sanitizes file upload arrays.
*
* @since 6.0.4
*
* @param array $args The file array.
*
* @return array
*/
function acf_sanitize_files_array( array $args = array() ) {
$defaults = array(
'name' => '',
'tmp_name' => '',
'type' => '',
'size' => 0,
'error' => '',
);
$args = wp_parse_args( $args, $defaults );
if ( empty( $args['name'] ) ) {
return $defaults;
}
if ( is_array( $args['name'] ) ) {
$files = array();
$files['name'] = acf_sanitize_files_value_array( $args['name'], 'sanitize_file_name' );
$files['tmp_name'] = acf_sanitize_files_value_array( $args['tmp_name'], 'sanitize_text_field' );
$files['type'] = acf_sanitize_files_value_array( $args['type'], 'sanitize_text_field' );
$files['size'] = acf_sanitize_files_value_array( $args['size'], 'absint' );
$files['error'] = acf_sanitize_files_value_array( $args['error'], 'absint' );
return $files;
}
$file = array();
$file['name'] = sanitize_file_name( $args['name'] );
$file['tmp_name'] = sanitize_text_field( $args['tmp_name'] );
$file['type'] = sanitize_text_field( $args['type'] );
$file['size'] = absint( $args['size'] );
$file['error'] = absint( $args['error'] );
return $file;
}
/**
* Sanitizes file upload values within the array.
*
* This addresses nested file fields within repeaters and groups.
*
* @since 6.0.5
*
* @param array $array The file upload array.
* @param string $sanitize_function Callback used to sanitize array value.
* @return array
*/
function acf_sanitize_files_value_array( $array, $sanitize_function ) {
if ( ! function_exists( $sanitize_function ) ) {
return $array;
}
if ( ! is_array( $array ) ) {
return $sanitize_function( $array );
}
foreach ( $array as $key => $value ) {
if ( is_array( $value ) ) {
$array[ $key ] = acf_sanitize_files_value_array( $value, $sanitize_function );
} else {
$array[ $key ] = $sanitize_function( $value );
}
}
return $array;
}

View File

@ -306,28 +306,29 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
}
/**
* Screen settings html output
* Screen settings html output
*
* @since 3.6.0
* @since 3.6.0
*
* @param string $html Current screen settings HTML.
* @return string $html
* @param string $html Current screen settings HTML.
* @return string $html
*/
public function screen_settings( $html ) {
$show_field_keys = acf_get_user_setting( 'show_field_keys' ) ? 'checked="checked"' : '';
$show_field_settings_tabs = acf_get_user_setting( 'show_field_settings_tabs', true ) ? 'checked="checked"' : '';
$hide_field_settings_tabs = apply_filters( 'acf/field_group/disable_field_settings_tabs', false );
// vars.
$checked = acf_get_user_setting( 'show_field_keys' ) ? 'checked="checked"' : '';
// append.
$html .= '<div id="acf-append-show-on-screen" class="acf-hidden">';
$html .= '<label for="acf-field-key-hide"><input id="acf-field-key-hide" type="checkbox" value="1" name="show_field_keys" ' . $checked . ' /> ' . __( 'Field Keys', 'acf' ) . '</label>';
$html .= '<label for="acf-field-key-hide"><input id="acf-field-key-hide" type="checkbox" value="1" name="show_field_keys" ' . $show_field_keys . ' /> ' . __( 'Field Keys', 'acf' ) . '</label>';
if ( ! $hide_field_settings_tabs ) {
$html .= '<label for="acf-field-settings-tabs"><input id="acf-field-settings-tabs" type="checkbox" value="1" name="show_field_settings_tabs" ' . $show_field_settings_tabs . ' />' . __( 'Field Settings Tabs', 'acf' ) . '</label>';
}
$html .= '</div>';
// return.
return $html;
}
/**
@ -406,7 +407,7 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
if ( ! empty( $_POST['acf_fields'] ) ) {
// loop.
foreach ( $_POST['acf_fields'] as $field ) {
foreach ( $_POST['acf_fields'] as $field ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized when saved.
if ( ! isset( $field['key'] ) ) {
continue;
@ -435,10 +436,10 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
}
// delete fields.
if ( $_POST['_acf_delete_fields'] ) {
if ( $_POST['_acf_delete_fields'] ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized below.
// clean.
$ids = explode( '|', $_POST['_acf_delete_fields'] );
$ids = explode( '|', $_POST['_acf_delete_fields'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized below.
$ids = array_map( 'intval', $ids );
// loop.
@ -456,19 +457,20 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
}
// add args.
$_POST['acf_field_group']['ID'] = $post_id;
$_POST['acf_field_group']['ID'] = $post_id;
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized when saved.
$_POST['acf_field_group']['title'] = $_POST['post_title'];
// save field group.
acf_update_field_group( $_POST['acf_field_group'] );
// phpcs:enable WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
// return.
return $post_id;
}
/**
* This function will render the HTML for the medtabox 'acf-field-group-fields'
* This function will render the HTML for the metabox 'acf-field-group-fields'
*
* @since 5.0.0
*
@ -549,7 +551,7 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
}
// validate rule.
$rule = acf_validate_location_rule( $_POST['rule'] );
$rule = acf_validate_location_rule( acf_sanitize_request_args( $_POST['rule'] ) );
// view.
acf_get_view(

View File

@ -578,7 +578,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Used for redirect notice.
// Display notice on success redirect.
if ( isset( $_GET['acfactivatecomplete'] ) ) {
$ids = array_map( 'intval', explode( ',', $_GET['acfactivatecomplete'] ) );
$ids = array_map( 'intval', explode( ',', $_GET['acfactivatecomplete'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized with intval().
// phpcs:enable WordPress.Security.NonceVerification.Recommended
// Generate text.
$text = sprintf(
@ -631,7 +631,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Used for redirect notice.
// Display notice on success redirect.
if ( isset( $_GET['acfdeactivatecomplete'] ) ) {
$ids = array_map( 'intval', explode( ',', $_GET['acfdeactivatecomplete'] ) );
$ids = array_map( 'intval', explode( ',', $_GET['acfdeactivatecomplete'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized with intval().
// phpcs:enable WordPress.Security.NonceVerification.Recommended
// Generate text.
$text = sprintf(
@ -689,7 +689,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Used for redirect notice.
// Display notice on success redirect.
if ( isset( $_GET['acfduplicatecomplete'] ) ) {
$ids = array_map( 'intval', explode( ',', $_GET['acfduplicatecomplete'] ) );
$ids = array_map( 'intval', explode( ',', $_GET['acfduplicatecomplete'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized with intval().
// phpcs:enable WordPress.Security.NonceVerification.Recommended
// Generate text.
$text = sprintf(
@ -747,7 +747,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
// phpcs:disable WordPress.Security.NonceVerification.Recommended
// Display notice on success redirect.
if ( isset( $_GET['acfsynccomplete'] ) ) {
$ids = array_map( 'intval', explode( ',', $_GET['acfsynccomplete'] ) );
$ids = array_map( 'intval', explode( ',', $_GET['acfsynccomplete'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized with intval().
// phpcs:enable WordPress.Security.NonceVerification.Recommended
// Generate text.
$text = sprintf(

View File

@ -94,8 +94,7 @@ if ( ! class_exists( 'ACF_Admin_Tool_Import' ) ) :
return acf_add_admin_notice( __( 'No file selected', 'acf' ), 'warning' );
}
// Get file data.
$file = $_FILES['acf_import_file'];
$file = acf_sanitize_files_array( $_FILES['acf_import_file'] );
// Check errors.
if ( $file['error'] ) {

View File

@ -75,7 +75,7 @@ if ( ! isset( $num_field_groups ) ) {
<li class="li-field-type">
<i class="field-type-icon field-type-icon-<?php echo acf_slugify( $field['type'] ); ?>"></i>
<span class="field-type-label">
<?php echo esc_html( $field_type_label ); ?>
<?php echo acf_esc_html( $field_type_label ); ?>
</span>
</li>
</ul>

View File

@ -126,8 +126,7 @@ acf_render_field_wrap(
'value' => $field_group['menu_order'],
),
'div',
'label',
true
'field'
);
echo '</div>';
@ -227,8 +226,7 @@ acf_render_field_wrap(
'value' => $field_group['description'],
),
'div',
'label',
true
'field'
);
// 3rd party settings

View File

@ -17,7 +17,7 @@ $title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post
</div>
</div>
<div class="acf-headerbar-actions">
<div class="acf-headerbar-actions" id="submitpost">
<a href="#" class="acf-btn acf-btn-secondary add-field"><i class="acf-icon acf-icon-plus"></i><?php _e( 'Add Field', 'acf' ); ?></a>
<button form="post" class="acf-btn acf-publish" type="submit"><?php _e( 'Save Changes', 'acf' ); ?></button>
</div>

View File

@ -786,7 +786,7 @@ function acf_verify_nonce( $value ) {
function acf_verify_ajax() {
// bail early if not acf nonce
if ( empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], 'acf_nonce' ) ) {
if ( empty( $_REQUEST['nonce'] ) || ! wp_verify_nonce( sanitize_text_field( $_REQUEST['nonce'] ), 'acf_nonce' ) ) {
return false;
}
@ -2699,21 +2699,7 @@ function acf_isset_termmeta( $taxonomy = '' ) {
*/
function acf_upload_files( $ancestors = array() ) {
// vars
$file = array(
'name' => '',
'type' => '',
'tmp_name' => '',
'error' => '',
'size' => '',
);
// populate with $_FILES data
foreach ( array_keys( $file ) as $k ) {
$file[ $k ] = $_FILES['acf'][ $k ];
}
$file = acf_sanitize_files_array( $_FILES['acf'] );
// walk through ancestors
if ( ! empty( $ancestors ) ) {
@ -2751,7 +2737,7 @@ function acf_upload_files( $ancestors = array() ) {
$field_key = end( $ancestors );
$nonce_name = $field_key . '_file_nonce';
if ( empty( $_REQUEST['acf'][ $nonce_name ] ) || ! wp_verify_nonce( $_REQUEST['acf'][ $nonce_name ], 'acf/file_uploader_nonce/' . $field_key ) ) {
if ( empty( $_REQUEST['acf'][ $nonce_name ] ) || ! wp_verify_nonce( sanitize_text_field( $_REQUEST['acf'][ $nonce_name ] ), 'acf/file_uploader_nonce/' . $field_key ) ) {
return;
}
@ -2932,13 +2918,13 @@ function acf_maybe_get( $array = array(), $key = 0, $default = null ) {
function acf_maybe_get_POST( $key = '', $default = null ) {
return isset( $_POST[ $key ] ) ? $_POST[ $key ] : $default; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing -- Checked elsewhere.
return isset( $_POST[ $key ] ) ? acf_sanitize_request_args( $_POST[ $key ] ) : $default; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing -- Checked elsewhere.
}
function acf_maybe_get_GET( $key = '', $default = null ) {
return isset( $_GET[ $key ] ) ? $_GET[ $key ] : $default; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Checked elsewhere.
return isset( $_GET[ $key ] ) ? acf_sanitize_request_args( $_GET[ $key ] ) : $default; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Checked elsewhere.
}
@ -3756,7 +3742,7 @@ function acf_get_browser() {
// Check server var.
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
$agent = $_SERVER['HTTP_USER_AGENT'];
$agent = sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] );
// Loop over search terms.
$browsers = array(

View File

@ -289,7 +289,7 @@ function get_field_objects( $post_id = false, $format_value = true, $load_value
foreach ( $meta as $key => $value ) {
// bail if reference key does not exist
if ( ! isset( $meta[ "_$key" ] ) ) {
if ( ! isset( $meta[ "_$key" ] ) || ( ! is_string( $meta[ "_$key" ] ) && ! is_numeric( $meta[ "_$key" ] ) ) ) {
continue;
}

View File

View File

@ -11,11 +11,11 @@ if ( ! class_exists( 'acf_field__accordion' ) ) :
*
* This function will setup the field type data
*
* @date 30/10/17
* @since 5.6.3
* @date 30/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
* @param n/a
* @return n/a
*/
function initialize() {
@ -29,7 +29,6 @@ if ( ! class_exists( 'acf_field__accordion' ) ) :
'multi_expand' => 0,
'endpoint' => 0,
);
}
@ -38,11 +37,11 @@ if ( ! class_exists( 'acf_field__accordion' ) ) :
*
* Create the HTML interface for your field
*
* @date 30/10/17
* @since 5.6.3
* @date 30/10/17
* @since 5.6.3
*
* @param array $field
* @return n/a
* @param array $field
* @return n/a
*/
function render_field( $field ) {
@ -108,7 +107,6 @@ if ( ! class_exists( 'acf_field__accordion' ) ) :
'ui' => 1,
)
);
}
@ -139,7 +137,6 @@ if ( ! class_exists( 'acf_field__accordion' ) ) :
// return
return $field;
}
}
@ -147,7 +144,6 @@ if ( ! class_exists( 'acf_field__accordion' ) ) :
// initialize
acf_register_field_type( 'acf_field__accordion' );
endif; // class_exists check
?>

View File

@ -141,20 +141,20 @@ if ( ! class_exists( 'acf_field_button_group' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Choices', 'acf' ),
'hint' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'type' => 'textarea',
'name' => 'choices',
'label' => __( 'Choices', 'acf' ),
'instructions' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'type' => 'textarea',
'name' => 'choices',
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Default Value', 'acf' ),
'hint' => __( 'Appears when creating a new post', 'acf' ),
'type' => 'text',
'name' => 'default_value',
'label' => __( 'Default Value', 'acf' ),
'instructions' => __( 'Appears when creating a new post', 'acf' ),
'type' => 'text',
'name' => 'default_value',
)
);

View File

@ -344,20 +344,20 @@ if ( ! class_exists( 'acf_field_checkbox' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Choices', 'acf' ),
'hint' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'type' => 'textarea',
'name' => 'choices',
'label' => __( 'Choices', 'acf' ),
'instructions' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'type' => 'textarea',
'name' => 'choices',
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Default Value', 'acf' ),
'hint' => __( 'Enter each default value on a new line', 'acf' ),
'type' => 'textarea',
'name' => 'default_value',
'label' => __( 'Default Value', 'acf' ),
'instructions' => __( 'Enter each default value on a new line', 'acf' ),
'type' => 'textarea',
'name' => 'default_value',
)
);

View File

@ -176,7 +176,7 @@ if ( ! class_exists( 'acf_field_date_picker' ) ) :
$field,
array(
'label' => __( 'Display Format', 'acf' ),
'instructions' => __( 'The format displayed when editing a post', 'acf' ),
'hint' => __( 'The format displayed when editing a post', 'acf' ),
'type' => 'radio',
'name' => 'display_format',
'other_choice' => 1,
@ -194,10 +194,10 @@ if ( ! class_exists( 'acf_field_date_picker' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Save Format', 'acf' ),
'instructions' => __( 'The format used when saving a value', 'acf' ),
'type' => 'text',
'name' => 'save_format',
'label' => __( 'Save Format', 'acf' ),
'hint' => __( 'The format used when saving a value', 'acf' ),
'type' => 'text',
'name' => 'save_format',
// 'readonly' => 1 // this setting was not readonly in v4
)
);
@ -206,7 +206,7 @@ if ( ! class_exists( 'acf_field_date_picker' ) ) :
$field,
array(
'label' => __( 'Return Format', 'acf' ),
'instructions' => __( 'The format returned via template functions', 'acf' ),
'hint' => __( 'The format returned via template functions', 'acf' ),
'type' => 'radio',
'name' => 'return_format',
'other_choice' => 1,

View File

@ -177,7 +177,7 @@ if ( ! class_exists( 'acf_field_date_and_time_picker' ) ) :
$field,
array(
'label' => __( 'Display Format', 'acf' ),
'instructions' => __( 'The format displayed when editing a post', 'acf' ),
'hint' => __( 'The format displayed when editing a post', 'acf' ),
'type' => 'radio',
'name' => 'display_format',
'other_choice' => 1,
@ -195,7 +195,7 @@ if ( ! class_exists( 'acf_field_date_and_time_picker' ) ) :
$field,
array(
'label' => __( 'Return Format', 'acf' ),
'instructions' => __( 'The format returned via template functions', 'acf' ),
'hint' => __( 'The format returned via template functions', 'acf' ),
'type' => 'radio',
'name' => 'return_format',
'other_choice' => 1,
@ -244,7 +244,7 @@ if ( ! class_exists( 'acf_field_date_and_time_picker' ) ) :
return acf_format_date( $value, $field['return_format'] );
}
/**
* This filter is applied to the $field after it is loaded from the database

View File

@ -452,6 +452,10 @@ if ( ! class_exists( 'acf_field_file' ) ) :
* @return bool|WP_Error
*/
public function validate_rest_value( $valid, $value, $field ) {
if ( is_null( $value ) && empty( $field['required'] ) ) {
return $valid;
}
/**
* A bit of a hack, but we use `wp_prepare_attachment_for_js()` here
* since it returns all the data we need to validate the file, and we use this anyways

View File

@ -190,7 +190,7 @@ if ( ! class_exists( 'acf_field_google_map' ) ) :
$field,
array(
'label' => __( 'Center', 'acf' ),
'instructions' => __( 'Center the initial map', 'acf' ),
'hint' => __( 'Center the initial map', 'acf' ),
'type' => 'text',
'name' => 'center_lat',
'prepend' => 'lat',
@ -203,7 +203,7 @@ if ( ! class_exists( 'acf_field_google_map' ) ) :
$field,
array(
'label' => __( 'Center', 'acf' ),
'instructions' => __( 'Center the initial map', 'acf' ),
'hint' => __( 'Center the initial map', 'acf' ),
'type' => 'text',
'name' => 'center_lng',
'prepend' => 'lng',

View File

@ -238,12 +238,12 @@ if ( ! class_exists( 'acf_field_image' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Minimum', 'acf' ),
'instructions' => __( 'Restrict which images can be uploaded', 'acf' ),
'type' => 'text',
'name' => 'min_width',
'prepend' => __( 'Width', 'acf' ),
'append' => 'px',
'label' => __( 'Minimum', 'acf' ),
'hint' => __( 'Restrict which images can be uploaded', 'acf' ),
'type' => 'text',
'name' => 'min_width',
'prepend' => __( 'Width', 'acf' ),
'append' => 'px',
)
);
@ -274,12 +274,12 @@ if ( ! class_exists( 'acf_field_image' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Maximum', 'acf' ),
'instructions' => __( 'Restrict which images can be uploaded', 'acf' ),
'type' => 'text',
'name' => 'max_width',
'prepend' => __( 'Width', 'acf' ),
'append' => 'px',
'label' => __( 'Maximum', 'acf' ),
'hint' => __( 'Restrict which images can be uploaded', 'acf' ),
'type' => 'text',
'name' => 'max_width',
'prepend' => __( 'Width', 'acf' ),
'append' => 'px',
)
);
@ -310,10 +310,10 @@ if ( ! class_exists( 'acf_field_image' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Allowed file types', 'acf' ),
'hint' => __( 'Comma separated list. Leave blank for all types', 'acf' ),
'type' => 'text',
'name' => 'mime_types',
'label' => __( 'Allowed file types', 'acf' ),
'instructions' => __( 'Comma separated list. Leave blank for all types', 'acf' ),
'type' => 'text',
'name' => 'mime_types',
)
);
}

View File

@ -186,20 +186,20 @@ if ( ! class_exists( 'acf_field_radio' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Choices', 'acf' ),
'hint' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'type' => 'textarea',
'name' => 'choices',
'label' => __( 'Choices', 'acf' ),
'instructions' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'type' => 'textarea',
'name' => 'choices',
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Default Value', 'acf' ),
'hint' => __( 'Appears when creating a new post', 'acf' ),
'type' => 'text',
'name' => 'default_value',
'label' => __( 'Default Value', 'acf' ),
'instructions' => __( 'Appears when creating a new post', 'acf' ),
'type' => 'text',
'name' => 'default_value',
)
);

View File

@ -537,7 +537,7 @@ if ( ! class_exists( 'acf_field_relationship' ) ) :
)
);
?>
<span data-id="<?php echo esc_attr( $post->ID ); ?>" class="acf-rel-item">
<span tabindex="0" data-id="<?php echo esc_attr( $post->ID ); ?>" class="acf-rel-item acf-rel-item-remove">
<?php echo acf_esc_html( $this->get_post_title( $post, $field ) ); ?>
<a href="#" class="acf-icon -minus small dark" data-name="remove_item"></a>
</span>

View File

@ -365,10 +365,10 @@ if ( ! class_exists( 'acf_field_select' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Choices', 'acf' ),
'hint' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'name' => 'choices',
'type' => 'textarea',
'label' => __( 'Choices', 'acf' ),
'instructions' => __( 'Enter each choice on a new line.', 'acf' ) . '<br />' . __( 'For more control, you may specify both a value and label like this:', 'acf' ) . '<br /><span class="acf-field-setting-example">' . __( 'red : Red', 'acf' ) . '</span>',
'name' => 'choices',
'type' => 'textarea',
)
);
@ -709,10 +709,10 @@ if ( ! class_exists( 'acf_field_select' ) ) :
);
$schema = array(
'type' => array( 'string', 'array', 'null' ),
'type' => array( 'string', 'array', 'int', 'null' ),
'required' => ! empty( $field['required'] ),
'items' => array(
'type' => array( 'string' ),
'type' => array( 'string', 'int' ),
'enum' => empty( $option_keys ) ? $field['choices'] : $option_keys,
),
);

View File

@ -110,7 +110,7 @@ if ( ! class_exists( 'acf_field_time_picker' ) ) :
$field,
array(
'label' => __( 'Display Format', 'acf' ),
'instructions' => __( 'The format displayed when editing a post', 'acf' ),
'hint' => __( 'The format displayed when editing a post', 'acf' ),
'type' => 'radio',
'name' => 'display_format',
'other_choice' => 1,
@ -126,7 +126,7 @@ if ( ! class_exists( 'acf_field_time_picker' ) ) :
$field,
array(
'label' => __( 'Return Format', 'acf' ),
'instructions' => __( 'The format returned via template functions', 'acf' ),
'hint' => __( 'The format returned via template functions', 'acf' ),
'type' => 'radio',
'name' => 'return_format',
'other_choice' => 1,
@ -139,7 +139,6 @@ if ( ! class_exists( 'acf_field_time_picker' ) ) :
);
echo '</div>';
}
/*
@ -186,7 +185,7 @@ if ( ! class_exists( 'acf_field_time_picker' ) ) :
}
return $field;
}
}
/**
* Return the schema array for the REST API.

View File

@ -131,10 +131,10 @@ if ( ! class_exists( 'acf_field_true_false' ) ) :
acf_render_field_setting(
$field,
array(
'label' => __( 'Message', 'acf' ),
'hint' => __( 'Displays text alongside the checkbox', 'acf' ),
'type' => 'text',
'name' => 'message',
'label' => __( 'Message', 'acf' ),
'instructions' => __( 'Displays text alongside the checkbox', 'acf' ),
'type' => 'text',
'name' => 'message',
)
);

View File

@ -328,10 +328,10 @@ if ( ! class_exists( 'ACF_Field_User' ) ) :
// phpcs:disable WordPress.Security.NonceVerification.Recommended
// Modify Request args.
if ( isset( $_REQUEST['s'] ) ) {
$_REQUEST['search'] = $_REQUEST['s'];
$_REQUEST['search'] = sanitize_text_field( $_REQUEST['s'] );
}
if ( isset( $_REQUEST['paged'] ) ) {
$_REQUEST['page'] = $_REQUEST['paged'];
$_REQUEST['page'] = absint( $_REQUEST['paged'] );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
@ -362,7 +362,7 @@ if ( ! class_exists( 'ACF_Field_User' ) ) :
}
// Verify that this is a legitimate request using a separate nonce from the main AJAX nonce.
if ( ! isset( $_REQUEST['user_query_nonce'] ) || ! wp_verify_nonce( $_REQUEST['user_query_nonce'], 'acf/fields/user/query' . $query->field['key']) ) {
if ( ! isset( $_REQUEST['user_query_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( $_REQUEST['user_query_nonce'] ), 'acf/fields/user/query' . $query->field['key']) ) {
$query->send( new WP_Error( 'acf_invalid_request', __( 'Invalid request.', 'acf' ), array( 'status' => 404 ) ) );
}
}

View File

@ -281,7 +281,7 @@ if ( ! class_exists( 'acf_form_comment' ) ) :
// kses
if ( isset( $_POST['acf'] ) ) {
$_POST['acf'] = wp_kses_post_deep( $_POST['acf'] );
$_POST['acf'] = wp_kses_post_deep( $_POST['acf'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized with wp_kses_post_deep().
}
// validate and save

View File

@ -282,14 +282,14 @@ if ( ! class_exists( 'acf_form_front' ) ) :
// save post_title
if ( isset( $_POST['acf']['_post_title'] ) ) {
$save['post_title'] = acf_extract_var( $_POST['acf'], '_post_title' );
$save['post_title'] = acf_extract_var( $_POST['acf'], '_post_title' ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by WP when saved.
}
// save post_content
if ( isset( $_POST['acf']['_post_content'] ) ) {
$save['post_content'] = acf_extract_var( $_POST['acf'], '_post_content' );
$save['post_content'] = acf_extract_var( $_POST['acf'], '_post_content' ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by WP when saved.
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
@ -373,11 +373,11 @@ if ( ! class_exists( 'acf_form_front' ) ) :
}
// Load registered form using id.
$form = $this->get_form( $_POST['_acf_form'] );
$form = $this->get_form( acf_sanitize_request_args( $_POST['_acf_form'] ) );
// Fallback to encrypted JSON.
if ( ! $form ) {
$form = json_decode( acf_decrypt( $_POST['_acf_form'] ), true );
$form = json_decode( acf_decrypt( sanitize_text_field( $_POST['_acf_form'] ) ), true );
if ( ! $form ) {
return false;
}
@ -385,7 +385,7 @@ if ( ! class_exists( 'acf_form_front' ) ) :
// Run kses on all $_POST data.
if ( $form['kses'] && isset( $_POST['acf'] ) ) {
$_POST['acf'] = wp_kses_post_deep( $_POST['acf'] );
$_POST['acf'] = wp_kses_post_deep( $_POST['acf'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- False positive.
}
// Validate data and show errors.

View File

@ -187,8 +187,9 @@ if ( ! class_exists( 'acf_form_nav_menu' ) ) :
return;
}
// loop
foreach ( $_POST['menu-item-acf'] as $post_id => $values ) {
$posted_values = acf_sanitize_request_args( $_POST['menu-item-acf'] );
foreach ( $posted_values as $post_id => $values ) {
acf_save_post( $post_id, $values );
@ -263,8 +264,9 @@ if ( ! class_exists( 'acf_form_nav_menu' ) ) :
return;
}
// loop
foreach ( $_POST['menu-item-acf'] as $post_id => $values ) {
$posted_values = acf_sanitize_request_args( $_POST['menu-item-acf'] );
foreach ( $posted_values as $post_id => $values ) {
// vars
$prefix = 'menu-item-acf[' . $post_id . ']';
@ -277,7 +279,6 @@ if ( ! class_exists( 'acf_form_nav_menu' ) ) :
}
/*
* admin_footer
*
@ -399,5 +400,4 @@ if ( ! class_exists( 'acf_form_nav_menu' ) ) :
acf_new_instance( 'acf_form_nav_menu' );
endif;
?>

View File

@ -372,9 +372,9 @@ if ( ! class_exists( 'ACF_Form_User' ) ) :
*/
function filter_pre_load_value( $null, $post_id, $field ) {
$field_key = $field['key'];
// phpcs:disable WordPress.Security.NonceVerification.Missing
// phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified in save_user().
if ( isset( $_POST['acf'][ $field_key ] ) ) {
return $_POST['acf'][ $field_key ];
return $_POST['acf'][ $field_key ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized elsewhere.
}
// phpcs:enable WordPress.Security.NonceVerification.Missing
return $null;

View File

@ -104,12 +104,13 @@ if ( ! class_exists( 'acf_form_widget' ) ) :
}
// vars
$id = $_POST['_acf_widget_id'];
$number = $_POST['_acf_widget_number'];
$prefix = $_POST['_acf_widget_prefix'];
$id = sanitize_text_field( $_POST['_acf_widget_id'] );
$number = sanitize_text_field( $_POST['_acf_widget_number'] );
$prefix = sanitize_text_field( $_POST['_acf_widget_prefix'] );
$values = acf_sanitize_request_args( $_POST[ $id ][ $number ]['acf'] );
// validate
acf_validate_values( $_POST[ $id ][ $number ]['acf'], $prefix );
acf_validate_values( $values, $prefix );
// phpcs:enable WordPress.Security.NonceVerification.Missing
}

View File

@ -163,7 +163,11 @@ function acf_add_local_field_group( $field_group ) {
// Generate key if only name is provided.
if ( ! $field_group['key'] ) {
$field_group['key'] = 'group_' . acf_slugify( $field_group['title'], '_' );
$field_group_key = 'group_' . acf_slugify( $field_group['title'], '_' );
if ( $field_group_key === 'group_' ) {
$field_group_key = 'group_' . md5( $field_group['title'] );
}
$field_group['key'] = $field_group_key;
}
// Bail early if field group already exists.

View File

@ -70,7 +70,7 @@ if ( ! class_exists( 'ACF_Location_Page_Template' ) ) :
$post_templates = acf_get_post_templates();
return array_merge(
array(
'default' => apply_filters( 'default_page_template_title', __( 'Default Template', 'acf' ) ),
'default' => apply_filters( 'default_page_template_title', __( 'Default Template', 'acf' ), 'meta-box' ),
),
$post_templates['page']
);

View File

@ -82,7 +82,7 @@ if ( ! class_exists( 'ACF_Location_Post_Template' ) ) :
public function get_values( $rule ) {
return array_merge(
array(
'default' => apply_filters( 'default_page_template_title', __( 'Default Template', 'acf' ) ),
'default' => apply_filters( 'default_page_template_title', __( 'Default Template', 'acf' ), 'meta-box' ),
),
acf_get_post_templates()
);

View File

@ -143,11 +143,11 @@ if ( ! class_exists( 'ACF_Media' ) ) :
// Search for field key within available data.
// Case 1) Media modal query.
if ( isset( $_POST['query']['_acfuploader'] ) ) {
$field_key = (string) $_POST['query']['_acfuploader'];
$field_key = sanitize_text_field( $_POST['query']['_acfuploader'] );
// Case 2) Media modal upload.
} elseif ( isset( $_POST['_acfuploader'] ) ) {
$field_key = (string) $_POST['_acfuploader'];
$field_key = sanitize_text_field( $_POST['_acfuploader'] );
}
// phpcs:enable WordPress.Security.NonceVerification.Missing

View File

@ -87,16 +87,20 @@ class ACF_Rest_Request {
* Determine the HTTP method of the current request.
*/
private function set_http_method() {
$this->http_method = strtoupper( $_SERVER['REQUEST_METHOD'] );
$this->http_method = 'GET';
if ( ! empty( $_SERVER['REQUEST_METHOD'] ) ) {
$this->http_method = strtoupper( sanitize_text_field( $_SERVER['REQUEST_METHOD'] ) );
}
// phpcs:disable WordPress.Security.NonceVerification.Recommended -- Verified elsewhere.
// HTTP method override for clients that can't use PUT/PATCH/DELETE. This is identical to WordPress'
// handling in \WP_REST_Server::serve_request(). This block of code should always be identical to that
// in core.
if ( isset( $_GET['_method'] ) ) {
$this->http_method = strtoupper( $_GET['_method'] );
$this->http_method = strtoupper( sanitize_text_field( $_GET['_method'] ) );
} elseif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) {
$this->http_method = strtoupper( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] );
$this->http_method = strtoupper( sanitize_text_field( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
}

View File

@ -162,11 +162,11 @@ if ( ! class_exists( 'acf_third_party' ) ) :
// check $_GET because it is too early to use functions / global vars.
if ( ! empty( $_GET['post_type'] ) ) {
$post_type = $_GET['post_type'];
$post_type = sanitize_text_field( $_GET['post_type'] );
} elseif ( ! empty( $_GET['post'] ) ) {
$post_type = get_post_type( $_GET['post'] );
$post_type = get_post_type( $_GET['post'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized when get_post_type() calls get_post().
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended

View File

@ -261,7 +261,7 @@ if ( ! class_exists( 'ACF_Updates' ) ) :
'wp' => wp_json_encode(
array(
'wp_name' => get_bloginfo( 'name' ),
'wp_url' => home_url(),
'wp_url' => acf_get_home_url(),
'wp_version' => get_bloginfo( 'version' ),
'wp_language' => get_bloginfo( 'language' ),
'wp_timezone' => get_option( 'timezone_string' ),

View File

@ -205,7 +205,7 @@ if ( ! class_exists( 'acf_validation' ) ) :
}
// validate
acf_validate_values( $_POST['acf'], 'acf' );
acf_validate_values( $_POST['acf'], 'acf' ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
// phpcs:enable WordPress.Security.NonceVerification.Missing
}

View File

@ -286,7 +286,7 @@ if ( ! class_exists( 'ACF_WPML_Compatibility' ) ) :
// this will allow get_posts to work as expected (load posts from the correct language)
if ( isset( $_REQUEST['lang'] ) ) {
global $sitepress;
$sitepress->switch_lang( $_REQUEST['lang'] );
$sitepress->switch_lang( sanitize_text_field( $_REQUEST['lang'] ) );
}
// phpcs:enable WordPress.Security.NonceVerification.Recommended
}

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2022-10-17T14:24:48+00:00\n"
"PO-Revision-Date: 2023-01-18T14:07:28+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: ar\n"
"MIME-Version: 1.0\n"

Some files were not shown because too many files have changed in this diff Show More