Update to v6.0.6

This commit is contained in:
Thomas Coutant 2023-01-16 16:12:12 +01:00
parent d21784caed
commit c02bb82120
177 changed files with 21727 additions and 16044 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.2
* Version: 6.0.6
* 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.2';
public $version = '6.0.6';
/**
* The plugin settings array.
@ -123,6 +123,7 @@ if ( ! class_exists( 'ACF' ) ) {
'rest_api_format' => 'light',
'rest_api_embed_links' => true,
'preload_blocks' => true,
'enable_shortcode' => true,
);
// Include utility functions.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -356,6 +356,7 @@
.acf-icon.-cancel:before {
content: "\f335";
margin: -1px 0 0 -1px;
}
.acf-icon.-pencil:before {
@ -436,7 +437,6 @@
position: relative;
}
.acf-icon.-duplicate:before, .acf-icon.-duplicate:after {
content: "";
display: block;
box-sizing: border-box;
width: 46%;
@ -453,6 +453,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;
@ -901,7 +922,6 @@ html[dir=rtl] #acf-popup .acf-popup-box .title .acf-icon {
#acf-upgrade-notice {
position: relative;
background: #fff;
border-left: 4px solid #00a0d2;
padding: 20px;
}
#acf-upgrade-notice:after {
@ -914,18 +934,24 @@ html[dir=rtl] #acf-popup .acf-popup-box .title .acf-icon {
width: 55%;
padding-left: 90px;
}
#acf-upgrade-notice .notice-container {
display: flex;
justify-content: space-between;
align-items: flex-start;
align-content: flex-start;
}
#acf-upgrade-notice .col-actions {
float: right;
text-align: center;
padding: 10px;
}
#acf-upgrade-notice img {
float: left;
width: 70px;
height: 70px;
width: 64px;
height: 64px;
margin: 0 0 0 -90px;
}
#acf-upgrade-notice h2 {
display: inline-block;
font-size: 16px;
margin: 2px 0 6.5px;
}
@ -938,7 +964,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;
@ -946,6 +972,14 @@ html[dir=rtl] #acf-popup .acf-popup-box .title .acf-icon {
}
}
#acf-upgrade-notice:has(.notice-container)::before, #acf-upgrade-notice:has(.notice-container)::after {
display: none;
}
#acf-upgrade-notice:has(.notice-container) {
padding-left: 20px !important;
}
/*--------------------------------------------------------------------------------------------
*
* Welcome
@ -1189,7 +1223,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;
@ -1561,7 +1595,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;
}
@ -1583,6 +1617,16 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
margin-left: 8px;
}
}
.post-type-acf-field-group.rtl .wrap {
margin-right: 12px;
margin-left: 32px;
}
@media screen and (max-width: 768px) {
.post-type-acf-field-group.rtl .wrap {
margin-right: 8px;
margin-left: 8px;
}
}
@media screen and (max-width: 768px) {
.post-type-acf-field-group #wpcontent {
padding-left: 0;
@ -1709,6 +1753,10 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
padding-left: 0;
color: #344054;
}
.rtl .acf-postbox-header h2.acf-postbox-title {
padding-right: 0;
padding-left: 24px;
}
.acf-postbox-header .acf-icon {
background-color: #98A2B3;
}
@ -1730,6 +1778,16 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
margin-bottom: 0;
}
}
.post-type-acf-field-group.rtl #screen-meta-links {
margin-right: 0;
margin-left: 32px;
}
@media screen and (max-width: 768px) {
.post-type-acf-field-group.rtl #screen-meta-links {
margin-right: 0;
margin-left: 16px;
}
}
.post-type-acf-field-group #screen-meta {
border-color: #D0D5DD;
}
@ -1967,7 +2025,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;
}
/*---------------------------------------------------------------------------------------------
@ -1993,19 +2051,19 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
* Headings
*
*---------------------------------------------------------------------------------------------*/
.h1, .post-type-acf-field-group h1,
.acf-h1, .post-type-acf-field-group h1,
.acf-headerbar h1 {
font-size: 21px;
font-weight: 400;
}
.h2, .acf-no-field-groups-wrapper .acf-no-field-groups-inner h2, .acf-page-title, .post-type-acf-field-group h2,
.acf-h2, .acf-no-field-groups-wrapper .acf-no-field-groups-inner h2, .acf-page-title, .post-type-acf-field-group h2,
.acf-headerbar h2 {
font-size: 18px;
font-weight: 400;
}
.h3, .post-type-acf-field-group h3,
.acf-h3, .post-type-acf-field-group h3,
.acf-headerbar h3, .post-type-acf-field-group .postbox .postbox-header h2,
.post-type-acf-field-group .postbox .postbox-header h3,
.post-type-acf-field-group .postbox .title h2,
@ -2024,44 +2082,40 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
* Paragraphs
*
*---------------------------------------------------------------------------------------------*/
.p1, #acf-field-group-pro-features h1 {
.post-type-acf-field-group .p1, .post-type-acf-field-group #acf-field-group-pro-features h1, #acf-field-group-pro-features .post-type-acf-field-group h1 {
font-size: 15px;
}
.p2, .acf-no-field-groups-wrapper .acf-no-field-groups-inner p, #acf-admin-tools .acf-meta-box-wrap .acf-fields .acf-label {
.post-type-acf-field-group .p2, .post-type-acf-field-group .acf-no-field-groups-wrapper .acf-no-field-groups-inner p, .acf-no-field-groups-wrapper .acf-no-field-groups-inner .post-type-acf-field-group p, .post-type-acf-field-group #acf-admin-tools .acf-meta-box-wrap .acf-fields .acf-label, #acf-admin-tools .acf-meta-box-wrap .acf-fields .post-type-acf-field-group .acf-label {
font-size: 14px;
}
.p3, .acf-admin-field-groups .wp-list-table .post-state, .post-type-acf-field-group .subtitle {
.post-type-acf-field-group .p3, .post-type-acf-field-group .acf-admin-field-groups .wp-list-table .post-state, .acf-admin-field-groups .wp-list-table .post-type-acf-field-group .post-state, .post-type-acf-field-group .subtitle {
font-size: 13.5px;
}
.p4, .acf-admin-toolbar a.acf-admin-toolbar-upgrade-btn p, #acf-update-information .form-table th,
#acf-update-information .form-table td, #acf-admin-tools.tool-export .acf-panel h3, .acf-btn.acf-btn-sm, .acf-admin-toolbar .acf-tab, .acf-admin-field-groups .subsubsub li, .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 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, .post-type-acf-field-group .acf-input .select2-container.-acf .select2-selection__rendered, .post-type-acf-field-group .button, .post-type-acf-field-group input[type=text],
.post-type-acf-field-group .p4, .post-type-acf-field-group .acf-admin-toolbar a.acf-admin-toolbar-upgrade-btn p, .acf-admin-toolbar a.acf-admin-toolbar-upgrade-btn .post-type-acf-field-group p, .post-type-acf-field-group #acf-update-information .form-table th, #acf-update-information .form-table .post-type-acf-field-group th,
.post-type-acf-field-group #acf-update-information .form-table td,
#acf-update-information .form-table .post-type-acf-field-group td, .post-type-acf-field-group #acf-admin-tools.tool-export .acf-panel h3, #acf-admin-tools.tool-export .acf-panel .post-type-acf-field-group h3, .post-type-acf-field-group .acf-btn.acf-btn-sm, .post-type-acf-field-group .acf-admin-toolbar .acf-tab, .acf-admin-toolbar .post-type-acf-field-group .acf-tab, .post-type-acf-field-group .acf-admin-field-groups .subsubsub li, .acf-admin-field-groups .subsubsub .post-type-acf-field-group li, .post-type-acf-field-group .acf-admin-field-groups .wp-list-table tbody th, .acf-admin-field-groups .wp-list-table tbody .post-type-acf-field-group th,
.post-type-acf-field-group .acf-admin-field-groups .wp-list-table tbody td,
.acf-admin-field-groups .wp-list-table tbody .post-type-acf-field-group td, .post-type-acf-field-group .acf-admin-field-groups .wp-list-table thead th, .acf-admin-field-groups .wp-list-table thead .post-type-acf-field-group th, .post-type-acf-field-group .acf-admin-field-groups .wp-list-table thead td, .acf-admin-field-groups .wp-list-table thead .post-type-acf-field-group td,
.post-type-acf-field-group .acf-admin-field-groups .wp-list-table tfoot th,
.acf-admin-field-groups .wp-list-table tfoot .post-type-acf-field-group th, .post-type-acf-field-group .acf-admin-field-groups .wp-list-table tfoot td, .acf-admin-field-groups .wp-list-table tfoot .post-type-acf-field-group td, .post-type-acf-field-group .acf-input .select2-container.-acf .select2-selection__rendered, .post-type-acf-field-group .button, .post-type-acf-field-group input[type=text],
.post-type-acf-field-group input[type=search],
.post-type-acf-field-group input[type=number],
.post-type-acf-field-group textarea,
.post-type-acf-field-group select {
font-size: 13px;
}
.p5, .acf-admin-field-groups .row-actions, .post-type-acf-field-group .notice .button,
.post-type-acf-field-group .p5, .post-type-acf-field-group .acf-admin-field-groups .row-actions, .acf-admin-field-groups .post-type-acf-field-group .row-actions, .post-type-acf-field-group .notice .button,
.post-type-acf-field-group #lost-connection-notice .button {
font-size: 12.5px;
}
.p6, #acf-update-information .acf-update-changelog p em, .acf-no-field-groups-wrapper .acf-no-field-groups-inner p.acf-small, .acf-admin-field-groups .row-actions, .acf-small {
.post-type-acf-field-group .p6, .post-type-acf-field-group #acf-update-information .acf-update-changelog p em, #acf-update-information .acf-update-changelog p .post-type-acf-field-group em, .post-type-acf-field-group .acf-no-field-groups-wrapper .acf-no-field-groups-inner p.acf-small, .acf-no-field-groups-wrapper .acf-no-field-groups-inner .post-type-acf-field-group p.acf-small, .post-type-acf-field-group .acf-admin-field-groups .row-actions, .acf-admin-field-groups .post-type-acf-field-group .row-actions, .post-type-acf-field-group .acf-small {
font-size: 12px;
}
.p7, .acf-tooltip, .post-type-acf-field-group .notice p.help,
.post-type-acf-field-group .p7, .post-type-acf-field-group .acf-tooltip, .post-type-acf-field-group .notice p.help,
.post-type-acf-field-group #lost-connection-notice p.help {
font-size: 11.5px;
}
.p8 {
.post-type-acf-field-group .p8 {
font-size: 11px;
}
@ -2261,6 +2315,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;
@ -2309,6 +2368,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");
}
@ -2370,12 +2434,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;
}
@ -2385,6 +2450,19 @@ 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;
}
.post-type-acf-field-group.rtl .acf-field-true-false .acf-tip {
margin-right: 12px;
margin-left: 0;
}
.post-type-acf-field-group input::file-selector-button {
box-sizing: border-box;
min-height: 40px;
@ -2522,6 +2600,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;
@ -2533,6 +2614,11 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
height: 18px;
}
.rtl.post-type-acf-field-group .acf-field-setting-name .acf-tip {
left: auto;
right: 654px;
}
/*---------------------------------------------------------------------------------------------
*
* Field Groups
@ -2578,7 +2664,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;
@ -2601,14 +2687,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;
}
}
@ -2628,7 +2714,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;
}
@ -2676,6 +2762,14 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
white-space: nowrap;
text-overflow: ellipsis;
}
.acf-admin-field-groups.rtl .wp-list-table .column-acf-key .acf-icon-key-solid {
margin-left: 4px;
margin-right: 0;
}
.acf-admin-field-groups.rtl .wp-list-table .acf-location .dashicons {
margin-left: 6px;
margin-right: 0;
}
.acf-admin-field-groups .row-actions {
margin-top: 2px;
padding-top: 0;
@ -2769,6 +2863,19 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
}
.rtl.acf-admin-field-groups #posts-filter p.search-box #post-search-input {
margin-right: 0;
margin-left: 8px;
}
@media screen and (max-width: 768px) {
.rtl.acf-admin-field-groups #posts-filter p.search-box {
padding-left: 24px;
padding-right: 0;
margin-left: 16px;
margin-right: 0;
}
}
/*--------------------------------------------------------------------------------------------
*
* Status tabs
@ -3002,8 +3109,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;
}
}
@ -3089,6 +3196,19 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
}
}
.rtl #wpcontent .acf-admin-toolbar {
margin-left: 0;
margin-right: -20px;
}
.rtl #wpcontent .acf-admin-toolbar .acf-tab {
margin-left: 8px;
margin-right: 0;
}
.rtl .acf-logo {
margin-right: 0;
margin-left: 32px;
}
/*---------------------------------------------------------------------------------------------
*
* Admin Toolbar Icons
@ -3105,6 +3225,10 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
.acf-admin-toolbar .acf-tab.is-active i.acf-icon, .acf-admin-toolbar .acf-tab:hover i.acf-icon {
background-color: #EAECF0;
}
.rtl .acf-admin-toolbar .acf-tab i.acf-icon {
margin-right: -2px;
margin-left: 8px;
}
.acf-admin-toolbar .acf-header-tab-acf-field-group i.acf-icon {
-webkit-mask-image: url("../../images/icons/icon-field-groups.svg");
mask-image: url("../../images/icons/icon-field-groups.svg");
@ -3192,13 +3316,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;
}
@ -3213,6 +3350,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;
}
/*---------------------------------------------------------------------------------------------
*
@ -3269,6 +3412,22 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
margin-right: 16px;
}
.rtl .acf-headerbar,
.rtl .acf-headerbar-field-editor {
margin-left: 0;
margin-right: -20px;
}
.rtl .acf-headerbar .acf-page-title,
.rtl .acf-headerbar-field-editor .acf-page-title {
margin-left: 16px;
margin-right: 0;
}
.rtl .acf-headerbar .acf-headerbar-actions .acf-btn,
.rtl .acf-headerbar-field-editor .acf-headerbar-actions .acf-btn {
margin-left: 0;
margin-right: 8px;
}
/*---------------------------------------------------------------------------------------------
*
* ACF Buttons
@ -3348,15 +3507,24 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
margin-left: -2px;
}
.rtl .acf-btn i.acf-icon {
margin-right: -4px;
margin-left: 6px;
}
.rtl .acf-btn.acf-btn-sm i.acf-icon {
margin-right: -4px;
margin-left: 2px;
}
/*---------------------------------------------------------------------------------------------
*
* Delete field group button
*
*---------------------------------------------------------------------------------------------*/
.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;
}
/*--------------------------------------------------------------------------------------------
@ -3394,6 +3562,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");
@ -3410,10 +3601,14 @@ 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-arrow-right {
-webkit-mask-image: url("../../images/icons/icon-arrow-right.svg");
mask-image: url("../../images/icons/icon-arrow-right.svg");
@ -3446,6 +3641,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;
}
@ -3511,6 +3714,18 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
mask-position: center;
}
.rtl #acf-field-group-fields .postbox-header h2:before,
.rtl #acf-field-group-fields .postbox-header h3:before,
.rtl #acf-field-group-fields .acf-sub-field-list-header h2:before,
.rtl #acf-field-group-fields .acf-sub-field-list-header h3:before,
.rtl #acf-field-group-options .postbox-header h2:before,
.rtl #acf-field-group-options .postbox-header h3:before,
.rtl #acf-field-group-options .acf-sub-field-list-header h2:before,
.rtl #acf-field-group-options .acf-sub-field-list-header h3:before {
margin-right: 0;
margin-left: 8px;
}
#acf-field-group-fields .postbox-header h2:before,
h3.acf-sub-field-list-title:before {
-webkit-mask-image: url("../../images/icons/icon-fields.svg");
@ -3527,15 +3742,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;
@ -3552,7 +3781,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");
}
@ -3598,6 +3830,17 @@ h3.acf-sub-field-list-title:before {
-webkit-mask-position: center;
mask-position: center;
}
.post-type-acf-field-group.rtl #acf-admin-tool-export h2:before,
.post-type-acf-field-group.rtl #acf-admin-tool-export h3:before,
.post-type-acf-field-group.rtl #acf-admin-tool-import h2:before,
.post-type-acf-field-group.rtl #acf-admin-tool-import h3:before,
.post-type-acf-field-group.rtl #acf-license-information h2:before,
.post-type-acf-field-group.rtl #acf-license-information h3:before,
.post-type-acf-field-group.rtl #acf-update-information h2:before,
.post-type-acf-field-group.rtl #acf-update-information h3:before {
margin-right: 0;
margin-left: 8px;
}
.post-type-acf-field-group #acf-admin-tool-export h2:before {
-webkit-mask-image: url("../../images/icons/icon-export.svg");
@ -3983,28 +4226,18 @@ h3.acf-sub-field-list-title:before {
*
*---------------------------------------------------------------------------------------------*/
.acf-settings-wrap.acf-updates {
display: grid;
grid-template-columns: 65% 1fr;
grid-template-rows: min-content 1.3fr;
gap: 32px 32px;
grid-template-areas: "acf-admin-notice acf-admin-notice" ". .";
}
@media screen and (max-width: 880px) {
.acf-settings-wrap.acf-updates {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: center;
grid-column-gap: 8px;
grid-row-gap: 8px;
}
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
}
.acf-admin-notice,
.post-type-acf-field-group .notice {
grid-area: acf-admin-notice;
margin-bottom: 0 !important;
.custom-fields_page_acf-settings-updates .acf-admin-notice,
.custom-fields_page_acf-settings-updates .acf-upgrade-notice,
.custom-fields_page_acf-settings-updates .notice {
flex: 1 1 100%;
}
/*---------------------------------------------------------------------------------------------
@ -4039,7 +4272,6 @@ h3.acf-sub-field-list-title:before {
flex: 1 1 100%;
margin-top: 16px;
margin-right: 0;
margin-bottom: 0 !important;
margin-left: 0;
}
@ -4048,11 +4280,21 @@ h3.acf-sub-field-list-title:before {
* License information
*
*---------------------------------------------------------------------------------------------*/
#acf-license-information {
flex: 1 1 65%;
margin-right: 32px;
}
@media screen and (max-width: 1024px) {
#acf-license-information {
margin-right: 0;
margin-bottom: 32px;
}
}
#acf-license-information .acf-activation-form {
margin-top: 24px;
}
#acf-license-information label {
font-weight: bold;
font-weight: 500;
}
#acf-license-information .acf-input-wrap {
margin-top: 8px;
@ -4067,6 +4309,10 @@ h3.acf-sub-field-list-title:before {
* Update information table
*
*---------------------------------------------------------------------------------------------*/
#acf-update-information {
flex: 1 1 35%;
max-width: calc(35% - 32px);
}
#acf-update-information .form-table th,
#acf-update-information .form-table td {
padding-top: 0;
@ -4170,7 +4416,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

@ -43,19 +43,19 @@
* Headings
*
*---------------------------------------------------------------------------------------------*/
.h1, .post-type-acf-field-group h1,
.acf-h1, .post-type-acf-field-group h1,
.acf-headerbar h1 {
font-size: 21px;
font-weight: 400;
}
.h2, .acf-page-title, .post-type-acf-field-group h2,
.acf-h2, .acf-page-title, .post-type-acf-field-group h2,
.acf-headerbar h2 {
font-size: 18px;
font-weight: 400;
}
.h3, .post-type-acf-field-group h3,
.acf-h3, .post-type-acf-field-group h3,
.acf-headerbar h3 {
font-size: 16px;
font-weight: 400;
@ -66,36 +66,30 @@
* Paragraphs
*
*---------------------------------------------------------------------------------------------*/
.p1 {
.post-type-acf-field-group .p1 {
font-size: 15px;
}
.p2 {
.post-type-acf-field-group .p2 {
font-size: 14px;
}
.p3 {
.post-type-acf-field-group .p3 {
font-size: 13.5px;
}
.p4 {
.post-type-acf-field-group .p4 {
font-size: 13px;
}
.p5 {
.post-type-acf-field-group .p5 {
font-size: 12.5px;
}
.p6, .acf-field p.description, .acf-small {
.post-type-acf-field-group .p6, .post-type-acf-field-group .acf-field p.description, .acf-field .post-type-acf-field-group p.description, .post-type-acf-field-group .acf-small {
font-size: 12px;
}
.p7, .acf-field-setting-prefix_label p.description code,
.acf-field-setting-prefix_name p.description code {
.post-type-acf-field-group .p7, .post-type-acf-field-group .acf-field-setting-prefix_label p.description code, .acf-field-setting-prefix_label p.description .post-type-acf-field-group code,
.post-type-acf-field-group .acf-field-setting-prefix_name p.description code,
.acf-field-setting-prefix_name p.description .post-type-acf-field-group code {
font-size: 11.5px;
}
.p8 {
.post-type-acf-field-group .p8 {
font-size: 11px;
}
@ -2886,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;
@ -2894,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;
}
/*---------------------------------------------------------------------------------------------
*

File diff suppressed because one or more lines are too long

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;

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 it is too large Load Diff

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 it is too large Load Diff

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 it is too large Load Diff

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 it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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;
}
});
@ -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,167 @@
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');
const subFieldsLabel = this.$el.find('> .acf-input > .acf-input-sub > .acf-sub-field-list-header > h3.acf-sub-field-list-title');
if (label) {
parentLabel.html(': ' + label);
subFieldsLabel.html(acf.__('Fields') + ': ' + label);
} else {
parentLabel.html('');
subFieldsLabel.html(acf.__('Fields'));
}
},
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('');
$el2.find('.acf-sub-field-list-title').html(acf.__('Fields '));
}
}); // 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 +399,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 +441,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'));
}
});
@ -388,6 +486,7 @@
* @param n/a
* @return n/a
*/
var RepeaterCollapsedFieldSetting = acf.FieldSetting.extend({
type: 'repeater',
name: 'collapsed',
@ -396,27 +495,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);
}
});

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 it is too large Load Diff

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 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 8V5.2c0-1.2.02-1.49.1-1.66 .09-.19.24-.35.43-.44 .16-.09.45-.11 1.65-.11h7.6c1.19 0 1.48.02 1.65.1 .18.09.34.24.43.43 .08.16.1.45.1 1.65v7.6c0 1.19-.03 1.48-.11 1.65 -.1.18-.25.34-.44.43 -.17.08-.46.1-1.66.1h-2.8c-.56 0-1 .44-1 1 0 .55.44 1 1 1h2.8c1.6 0 1.98-.04 2.56-.33 .56-.29 1.02-.75 1.31-1.32 .29-.59.32-.97.32-2.57v-7.6c0-1.61-.04-1.99-.33-2.57 -.29-.57-.75-1.03-1.32-1.32 -.59-.3-.97-.33-2.57-.33h-7.6c-1.61 0-1.99.03-2.57.32 -.57.28-1.03.74-1.32 1.31 -.3.58-.33.96-.33 2.56v2.8c0 .55.44 1 1 1 .55 0 1-.45 1-1ZM5.2 23h7.6c1.6 0 1.98-.04 2.56-.33 .56-.29 1.02-.75 1.31-1.32 .29-.59.32-.97.32-2.57v-7.6c0-1.61-.04-1.99-.33-2.57 -.29-.57-.75-1.03-1.32-1.32 -.59-.3-.97-.33-2.57-.33h-7.6c-1.61 0-1.99.03-2.57.32 -.57.28-1.03.74-1.32 1.31 -.3.58-.33.96-.33 2.56v7.6c0 1.6.03 1.98.32 2.56 .28.56.74 1.02 1.31 1.31 .58.29.96.32 2.56.32Zm0-2c-1.2 0-1.49-.03-1.66-.11 -.19-.1-.35-.25-.44-.44 -.09-.17-.11-.46-.11-1.66v-7.6c0-1.2.02-1.49.1-1.66 .09-.19.24-.35.43-.44 .16-.09.45-.11 1.65-.11h7.6c1.19 0 1.48.02 1.65.1 .18.09.34.24.43.43 .08.16.1.45.1 1.65v7.6c0 1.19-.03 1.48-.11 1.65 -.1.18-.25.34-.44.43 -.17.08-.46.1-1.66.1h-7.6Z"/></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

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

@ -223,6 +223,7 @@ function acf_validate_field( $field = array() ) {
'key' => '',
'label' => '',
'name' => '',
'aria-label' => '',
'prefix' => '',
'type' => 'text',
'value' => null,
@ -745,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";
@ -757,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 );
}
@ -919,6 +916,14 @@ function acf_render_field_setting( $field, $setting, $global = false ) {
$setting['wrapper']['data-setting'] = $field['type'];
}
// Add classes for appended and prepended fields.
if ( ! empty( $setting['append'] ) ) {
$setting['wrapper']['class'] .= ' acf-field-appended';
}
if ( ! empty( $setting['prepend'] ) ) {
$setting['wrapper']['class'] .= ' acf-field-prepended';
}
// Copy across prefix.
$setting['prefix'] = $field['prefix'];
@ -941,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 '';
}
@ -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

@ -158,6 +158,8 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
'Move field group to trash?' => __( 'Move field group to trash?', 'acf' ),
'No toggle fields available' => __( 'No toggle fields available', 'acf' ),
'Move Custom Field' => __( 'Move Custom Field', 'acf' ),
'Close modal' => __( 'Close modal', 'acf' ),
'Field moved to other group' => __( 'Field moved to other group', 'acf' ),
'Checked' => __( 'Checked', 'acf' ),
'(no label)' => __( '(no label)', 'acf' ),
'(this field)' => __( '(this field)', 'acf' ),
@ -304,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;
}
/**
@ -404,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;
@ -433,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.
@ -454,13 +457,14 @@ 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;
}
@ -547,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(
@ -666,7 +670,7 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
esc_html( $field['label'] ),
$link //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
) . '</p>' .
'<a href="#" class="button button-primary acf-close-popup">' . __( 'Close Window', 'acf' ) . '</a>';
'<a href="#" class="button button-primary acf-close-popup">' . __( 'Close Modal', 'acf' ) . '</a>';
die();
}
@ -698,9 +702,10 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) {
// render options.
$field = acf_get_valid_field(
array(
'type' => 'select',
'name' => 'acf_field_group',
'choices' => $choices,
'type' => 'select',
'name' => 'acf_field_group',
'choices' => $choices,
'aria-label' => __( 'Please select the destination for this field', 'acf' ),
)
);

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

@ -70,13 +70,12 @@ if ( ! isset( $num_field_groups ) ) {
<a class="delete-field" title="<?php _e( 'Delete field', 'acf' ); ?>" href="#"><?php _e( 'Delete', 'acf' ); ?></a>
</div>
</li>
<?php // whitespace before field name looks odd but fixes chrome bug selecting all text in row ?>
<li class="li-field-name"> <?php echo esc_html( $field['name'] ); ?></li>
<li class="li-field-key"> <?php echo esc_html( $field['key'] ); ?></li>
<li class="li-field-name"><span class="copyable"><?php echo esc_html( $field['name'] ); ?></span></li>
<li class="li-field-key"><span class="copyable"><?php echo esc_html( $field['key'] ); ?></span></li>
<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

@ -21,21 +21,20 @@ if ( ! acf_get_setting( 'pro' ) ) {
?>
<div id="acf-upgrade-notice" class="notice">
<div class="notice-container">
<div class="col-content">
<img src="<?php echo acf_get_url( 'assets/images/acf-logo.png' ); ?>" />
<h2><?php _e( 'Database Upgrade Required', 'acf' ); ?></h2>
<p><?php printf( __( 'Thank you for updating to %1$s v%2$s!', 'acf' ), acf_get_setting( 'name' ), acf_get_setting( 'version' ) ); ?><br /><?php _e( 'This version contains improvements to your database and requires an upgrade.', 'acf' ); ?></p>
<?php if ( ! empty( $plugins ) ) : ?>
<p><?php printf( __( 'Please also check all premium add-ons (%s) are updated to the latest version.', 'acf' ), implode( ', ', $plugins ) ); ?></p>
<?php endif; ?>
</div>
<div class="col-actions">
<a id="acf-upgrade-button" href="<?php echo $button_url; ?>" class="acf-btn"><?php echo $button_text; ?></a>
</div>
<div class="col-content">
<img src="<?php echo acf_get_url( 'assets/images/acf-logo.png' ); ?>" />
<h2><?php _e( 'Database Upgrade Required', 'acf' ); ?></h2>
<p><?php printf( __( 'Thank you for updating to %1$s v%2$s!', 'acf' ), acf_get_setting( 'name' ), acf_get_setting( 'version' ) ); ?><br /><?php _e( 'This version contains improvements to your database and requires an upgrade.', 'acf' ); ?></p>
<?php if ( ! empty( $plugins ) ) : ?>
<p><?php printf( __( 'Please also check all premium add-ons (%s) are updated to the latest version.', 'acf' ), implode( ', ', $plugins ) ); ?></p>
<?php endif; ?>
</div>
<div class="col-actions">
<a id="acf-upgrade-button" href="<?php echo $button_url; ?>" class="button button-primary button-hero"><?php echo $button_text; ?></a>
</div>
</div>
<?php if ( $confirm ) : ?>
<script type="text/javascript">

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;
}
@ -849,9 +849,27 @@ function get_row_layout() {
* @return string
*/
function acf_shortcode( $atts ) {
// Return if the ACF shortcode is disabled.
if ( ! acf_get_setting( 'enable_shortcode' ) ) {
return;
}
if ( function_exists( 'wp_is_block_theme' ) && wp_is_block_theme() ) {
// Prevent the ACF shortcode in FSE block template parts by default.
if ( ! doing_filter( 'the_content' ) && ! apply_filters( 'acf/shortcode/allow_in_block_themes_outside_content', false ) ) {
return;
}
}
// Limit previews of ACF shortcode data for users without publish_posts permissions.
$preview_capability = apply_filters( 'acf/shortcode/preview_capability', 'publish_posts' );
if ( is_preview() && ! current_user_can( $preview_capability ) ) {
return apply_filters( 'acf/shortcode/preview_capability_message', __( '[ACF shortcode value disabled for preview]', 'acf' ) );
}
// Mitigate issue where some AJAX requests can return ACF field data.
$capability = apply_filters( 'acf/ajax/shortcode_capability', 'edit_posts' );
if ( wp_doing_ajax() && ( $capability !== false ) && ! current_user_can( $capability ) ) {
$ajax_capability = apply_filters( 'acf/ajax/shortcode_capability', 'edit_posts' );
if ( wp_doing_ajax() && ( $ajax_capability !== false ) && ! current_user_can( $ajax_capability ) ) {
return;
}

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,

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

@ -290,6 +290,10 @@ if ( ! class_exists( 'acf_field_select' ) ) :
'data-allow_null' => $field['allow_null'],
);
if ( $field['aria-label'] ) {
$select['aria-label'] = $field['aria-label'];
}
// multiple
if ( $field['multiple'] ) {
@ -361,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',
)
);
@ -705,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

@ -779,17 +779,7 @@ if ( ! class_exists( 'acf_field_taxonomy' ) ) :
),
)
);
}
/**
* Renders the field settings used in the "Validation" tab.
*
* @since 6.0
*
* @param array $field The field settings array.
* @return void
*/
function render_field_validation_settings( $field ) {
acf_render_field_setting(
$field,
array(

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

@ -319,22 +319,6 @@ if ( ! class_exists( 'acf_field_wysiwyg' ) ) :
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Delay initialization?', 'acf' ),
'instructions' => __( 'TinyMCE will not be initialized until field is clicked', 'acf' ),
'name' => 'delay',
'type' => 'true_false',
'ui' => 1,
'conditions' => array(
'field' => 'tabs',
'operator' => '!=',
'value' => 'text',
),
)
);
}
/**
@ -402,6 +386,22 @@ if ( ! class_exists( 'acf_field_wysiwyg' ) ) :
'ui' => 1,
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Delay initialization?', 'acf' ),
'instructions' => __( 'TinyMCE will not be initialized until field is clicked', 'acf' ),
'name' => 'delay',
'type' => 'true_false',
'ui' => 1,
'conditions' => array(
'field' => 'tabs',
'operator' => '!=',
'value' => 'text',
),
)
);
}
/**

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

@ -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
}

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2022-09-29T12:15:07+00:00\n"
"PO-Revision-Date: 2022-12-13T15:07:38+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: ar\n"
"MIME-Version: 1.0\n"

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2022-09-29T12:15:07+00:00\n"
"PO-Revision-Date: 2022-12-13T15:07:38+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: bg_BG\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -12,7 +12,7 @@
# This file is distributed under the same license as Advanced Custom Fields.
msgid ""
msgstr ""
"PO-Revision-Date: 2022-09-29T12:15:07+00:00\n"
"PO-Revision-Date: 2022-12-13T15:07:38+00:00\n"
"Report-Msgid-Bugs-To: http://support.advancedcustomfields.com\n"
"Language: de_CH\n"
"MIME-Version: 1.0\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

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