47a0306b by Jeff Balicki

staff

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 8c411026
Showing 373 changed files with 4943 additions and 0 deletions
/*!***************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./src/advanced-custom-fields-pro/assets/src/sass/acf-dark.scss ***!
\***************************************************************************************************************************************************************************************************************/
/*--------------------------------------------------------------------------------------------
*
* Dark mode
*
* WordPress plugin: https://en-au.wordpress.org/plugins/dark-mode/
* Github Documentation: https://github.com/danieltj27/Dark-Mode/wiki/Help:-Plugin-Compatibility-Guide
*
*--------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
*
* Global
*
*---------------------------------------------------------------------------------------------*/
.acf-box {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-box .title,
.acf-box .footer {
border-color: #23282d;
}
.acf-box h2 {
color: #bbc8d4;
}
.acf-box table, .acf-box tbody, .acf-box tr {
background: transparent !important;
}
.acf-thead {
color: #bbc8d4;
border-color: #191f25;
}
.acf-tfoot {
background-color: #2d3136;
border-color: #23282d;
}
.acf-table.-clear,
.acf-table.-clear tr {
background: transparent !important;
}
.acf-loading-overlay {
background: rgba(0, 0, 0, 0.5);
}
/*---------------------------------------------------------------------------------------------
*
* Fields
*
*---------------------------------------------------------------------------------------------*/
.acf-fields > .acf-field {
border-color: #23282d;
}
.acf-fields.-left > .acf-field:before {
background: rgba(0, 0, 0, 0.1);
border-color: #23282d;
}
.acf-fields.-border {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-field[data-width] + .acf-field[data-width] {
border-color: #23282d;
}
.acf-input-prepend,
.acf-input-append {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-fields > .acf-tab-wrap {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-fields > .acf-tab-wrap .acf-tab-group {
background-color: #2d3136;
border-color: #23282d;
}
.acf-fields > .acf-tab-wrap .acf-tab-group li a {
background-color: #2d3136;
border-color: #23282d;
}
.acf-fields > .acf-tab-wrap .acf-tab-group li a:hover {
background-color: #2d3136;
border-color: #23282d;
color: #bbc8d4;
}
.acf-fields > .acf-tab-wrap .acf-tab-group li.active a {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-fields.-sidebar:before {
background-color: #2d3136;
border-color: #23282d;
}
.acf-fields.-sidebar.-left:before {
background-color: #2d3136;
border-color: #23282d;
background: #23282d;
}
.acf-fields.-sidebar.-left > .acf-tab-wrap.-left .acf-tab-group li a {
background-color: #2d3136;
border-color: #23282d;
}
.acf-fields.-sidebar.-left > .acf-tab-wrap.-left .acf-tab-group li.active a {
background-color: #2d3136;
border-color: #23282d;
}
.acf-file-uploader .show-if-value {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-file-uploader .show-if-value .file-icon {
background-color: #2d3136;
border-color: #23282d;
}
.acf-oembed {
background-color: #2d3136;
border-color: #23282d;
}
.acf-oembed .title {
background-color: #50626f;
border-color: #191f25;
color: #fff;
}
.acf-gallery {
background-color: #2d3136;
border-color: #23282d;
}
.acf-gallery .acf-gallery-main {
background: #23282d;
}
.acf-gallery .acf-gallery-attachment .margin {
background-color: #2d3136;
border-color: #23282d;
}
.acf-gallery .acf-gallery-side {
background-color: #2d3136;
border-color: #23282d;
}
.acf-gallery .acf-gallery-side .acf-gallery-side-info {
background-color: #2d3136;
border-color: #23282d;
}
.acf-gallery .acf-gallery-toolbar {
background-color: #2d3136;
border-color: #23282d;
}
.acf-button-group label:not(.selected) {
background-color: #2d3136;
border-color: #23282d;
}
.acf-switch:not(.-on) {
background-color: #2d3136;
border-color: #23282d;
}
.acf-switch:not(.-on) .acf-switch-slider {
background-color: #50626f;
border-color: #191f25;
color: #fff;
}
.acf-link .link-wrap {
background-color: #2d3136;
border-color: #23282d;
}
.acf-relationship .filters {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-relationship .selection {
background-color: #2d3136;
border-color: #23282d;
}
.acf-relationship .selection .choices,
.acf-relationship .selection .choices-list,
.acf-relationship .selection .values {
background-color: #2d3136;
border-color: #23282d;
}
.acf-taxonomy-field .categorychecklist-holder {
background-color: #2d3136;
border-color: #23282d;
}
.acf-google-map {
background-color: #2d3136;
border-color: #23282d;
}
.acf-google-map .title {
background-color: #50626f;
border-color: #191f25;
color: #fff;
}
.acf-accordion {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-field.acf-accordion .acf-accordion-content > .acf-fields {
border-color: #191f25;
}
.acf-flexible-content .layout {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
.acf-flexible-content .layout .acf-fc-layout-handle {
background-color: #2d3136;
border-color: #23282d;
}
.acf-flexible-content .layout .acf-fc-layout-handle .acf-fc-layout-order {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
#wpbody .acf-table {
background-color: #2d3136;
border-color: #23282d;
}
#wpbody .acf-table > tbody > tr,
#wpbody .acf-table > thead > tr {
background: transparent;
}
#wpbody .acf-table > tbody > tr > td,
#wpbody .acf-table > tbody > tr > th,
#wpbody .acf-table > thead > tr > td,
#wpbody .acf-table > thead > tr > th {
border-color: #191f25;
}
.acf-field select optgroup, .acf-field select optgroup:nth-child(2n) {
background: #50626f;
}
/*---------------------------------------------------------------------------------------------
*
* Field Group
*
*---------------------------------------------------------------------------------------------*/
#acf-field-group-fields .acf-field-list-wrap {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
#acf-field-group-fields .acf-field-list .no-fields-message {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
}
#acf-field-group-fields .acf-field-object {
background-color: #32373c;
border-color: #191f25;
color: #bbc8d4;
border-color: #23282d;
}
#acf-field-group-fields .acf-field-object table, #acf-field-group-fields .acf-field-object tbody, #acf-field-group-fields .acf-field-object tr, #acf-field-group-fields .acf-field-object td, #acf-field-group-fields .acf-field-object th {
background: transparent;
border-color: #23282d;
}
#acf-field-group-fields .acf-field-object .acf-field .acf-label {
background-color: #2d3136;
border-color: #23282d;
}
#acf-field-group-fields .acf-field-object.ui-sortable-helper {
border-color: #191f25;
box-shadow: none;
}
#acf-field-group-fields .acf-field-object.ui-sortable-placeholder {
background-color: #2d3136;
border-color: #23282d;
box-shadow: none;
}
#acf-field-group-fields .acf-field-object + .acf-field-object-tab::before,
#acf-field-group-fields .acf-field-object + .acf-field-object-accordion::before {
background-color: #2d3136;
border-color: #23282d;
}
/*---------------------------------------------------------------------------------------------
*
* Admin: Tools
*
*---------------------------------------------------------------------------------------------*/
.acf-meta-box-wrap .acf-fields {
background-color: #50626f;
border-color: #191f25;
color: #fff;
background: transparent;
}
/*# sourceMappingURL=acf-dark.css.map*/
\ No newline at end of file
.acf-box{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-box .title,.acf-box .footer{border-color:#23282d}.acf-box h2{color:#bbc8d4}.acf-box table,.acf-box tbody,.acf-box tr{background:transparent !important}.acf-thead{color:#bbc8d4;border-color:#191f25}.acf-tfoot{background-color:#2d3136;border-color:#23282d}.acf-table.-clear,.acf-table.-clear tr{background:transparent !important}.acf-loading-overlay{background:rgba(0,0,0,.5)}.acf-fields>.acf-field{border-color:#23282d}.acf-fields.-left>.acf-field:before{background:rgba(0,0,0,.1);border-color:#23282d}.acf-fields.-border{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-field[data-width]+.acf-field[data-width]{border-color:#23282d}.acf-input-prepend,.acf-input-append{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-fields>.acf-tab-wrap{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-fields>.acf-tab-wrap .acf-tab-group{background-color:#2d3136;border-color:#23282d}.acf-fields>.acf-tab-wrap .acf-tab-group li a{background-color:#2d3136;border-color:#23282d}.acf-fields>.acf-tab-wrap .acf-tab-group li a:hover{background-color:#2d3136;border-color:#23282d;color:#bbc8d4}.acf-fields>.acf-tab-wrap .acf-tab-group li.active a{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-fields.-sidebar:before{background-color:#2d3136;border-color:#23282d}.acf-fields.-sidebar.-left:before{background-color:#2d3136;border-color:#23282d;background:#23282d}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group li a{background-color:#2d3136;border-color:#23282d}.acf-fields.-sidebar.-left>.acf-tab-wrap.-left .acf-tab-group li.active a{background-color:#2d3136;border-color:#23282d}.acf-file-uploader .show-if-value{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-file-uploader .show-if-value .file-icon{background-color:#2d3136;border-color:#23282d}.acf-oembed{background-color:#2d3136;border-color:#23282d}.acf-oembed .title{background-color:#50626f;border-color:#191f25;color:#fff}.acf-gallery{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-main{background:#23282d}.acf-gallery .acf-gallery-attachment .margin{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-side{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-side .acf-gallery-side-info{background-color:#2d3136;border-color:#23282d}.acf-gallery .acf-gallery-toolbar{background-color:#2d3136;border-color:#23282d}.acf-button-group label:not(.selected){background-color:#2d3136;border-color:#23282d}.acf-switch:not(.-on){background-color:#2d3136;border-color:#23282d}.acf-switch:not(.-on) .acf-switch-slider{background-color:#50626f;border-color:#191f25;color:#fff}.acf-link .link-wrap{background-color:#2d3136;border-color:#23282d}.acf-relationship .filters{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-relationship .selection{background-color:#2d3136;border-color:#23282d}.acf-relationship .selection .choices,.acf-relationship .selection .choices-list,.acf-relationship .selection .values{background-color:#2d3136;border-color:#23282d}.acf-taxonomy-field .categorychecklist-holder{background-color:#2d3136;border-color:#23282d}.acf-google-map{background-color:#2d3136;border-color:#23282d}.acf-google-map .title{background-color:#50626f;border-color:#191f25;color:#fff}.acf-accordion{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-field.acf-accordion .acf-accordion-content>.acf-fields{border-color:#191f25}.acf-flexible-content .layout{background-color:#32373c;border-color:#191f25;color:#bbc8d4}.acf-flexible-content .layout .acf-fc-layout-handle{background-color:#2d3136;border-color:#23282d}.acf-flexible-content .layout .acf-fc-layout-handle .acf-fc-layout-order{background-color:#32373c;border-color:#191f25;color:#bbc8d4}#wpbody .acf-table{background-color:#2d3136;border-color:#23282d}#wpbody .acf-table>tbody>tr,#wpbody .acf-table>thead>tr{background:transparent}#wpbody .acf-table>tbody>tr>td,#wpbody .acf-table>tbody>tr>th,#wpbody .acf-table>thead>tr>td,#wpbody .acf-table>thead>tr>th{border-color:#191f25}.acf-field select optgroup,.acf-field select optgroup:nth-child(2n){background:#50626f}#acf-field-group-fields .acf-field-list-wrap{background-color:#32373c;border-color:#191f25;color:#bbc8d4}#acf-field-group-fields .acf-field-list .no-fields-message{background-color:#32373c;border-color:#191f25;color:#bbc8d4}#acf-field-group-fields .acf-field-object{background-color:#32373c;border-color:#191f25;color:#bbc8d4;border-color:#23282d}#acf-field-group-fields .acf-field-object table,#acf-field-group-fields .acf-field-object tbody,#acf-field-group-fields .acf-field-object tr,#acf-field-group-fields .acf-field-object td,#acf-field-group-fields .acf-field-object th{background:transparent;border-color:#23282d}#acf-field-group-fields .acf-field-object .acf-field .acf-label{background-color:#2d3136;border-color:#23282d}#acf-field-group-fields .acf-field-object.ui-sortable-helper{border-color:#191f25;box-shadow:none}#acf-field-group-fields .acf-field-object.ui-sortable-placeholder{background-color:#2d3136;border-color:#23282d;box-shadow:none}#acf-field-group-fields .acf-field-object+.acf-field-object-tab::before,#acf-field-group-fields .acf-field-object+.acf-field-object-accordion::before{background-color:#2d3136;border-color:#23282d}.acf-meta-box-wrap .acf-fields{background-color:#50626f;border-color:#191f25;color:#fff;background:transparent}
#acf-field-group-fields>.inside,#acf-field-group-locations>.inside,#acf-field-group-options>.inside{padding:0;margin:0}.postbox .handle-order-higher,.postbox .handle-order-lower{display:none}#minor-publishing-actions,#misc-publishing-actions #visibility,#misc-publishing-actions .edit-timestamp{display:none}#minor-publishing{border-bottom:0 none}#misc-pub-section{border-bottom:0 none}#misc-publishing-actions .misc-pub-section{border-bottom-color:#f5f5f5}#acf-field-group-fields{border:0 none;box-shadow:none}#acf-field-group-fields>.postbox-header,#acf-field-group-fields>.handlediv,#acf-field-group-fields>.hndle{display:none}#acf-field-group-fields a{text-decoration:none}#acf-field-group-fields a:active,#acf-field-group-fields a:focus{outline:none;box-shadow:none}#acf-field-group-fields .li-field-order{width:20%}#acf-field-group-fields .li-field-label{width:30%}#acf-field-group-fields .li-field-name{width:25%}#acf-field-group-fields .li-field-type{width:25%}#acf-field-group-fields .li-field-key{display:none}#acf-field-group-fields.show-field-keys .li-field-label,#acf-field-group-fields.show-field-keys .li-field-name,#acf-field-group-fields.show-field-keys .li-field-type,#acf-field-group-fields.show-field-keys .li-field-key{width:20%}#acf-field-group-fields.show-field-keys .li-field-key{display:block}#acf-field-group-fields .acf-field-list-wrap{border:#ccd0d4 solid 1px}#acf-field-group-fields .acf-field-list{background:#f5f5f5;margin-top:-1px}#acf-field-group-fields .acf-field-list .no-fields-message{padding:15px 15px;background:#fff;display:none}#acf-field-group-fields .acf-field-list.-empty .no-fields-message{display:block}.acf-admin-3-8 #acf-field-group-fields .acf-field-list-wrap{border-color:#dfdfdf}.acf-field-object{border-top:#eee solid 1px;background:#fff}.acf-field-object.ui-sortable-helper{border-top-color:#fff;box-shadow:0 0 0 1px #dfdfdf,0 1px 4px rgba(0,0,0,.1)}.acf-field-object.ui-sortable-placeholder{box-shadow:0 -1px 0 0 #dfdfdf;visibility:visible !important;background:#f9f9f9;border-top-color:transparent;min-height:54px}.acf-field-object.ui-sortable-placeholder:after,.acf-field-object.ui-sortable-placeholder:before{visibility:hidden}.acf-field-object>.meta{display:none}.acf-field-object>.handle a{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.acf-field-object>.handle li{padding-top:10px;padding-bottom:10px;word-wrap:break-word}.acf-field-object>.handle .acf-icon{margin:1px 0 0;cursor:move;background:transparent;float:left;height:28px;line-height:26px;width:28px;font-size:13px;color:#444;position:relative;z-index:1}.acf-field-object>.handle strong{display:block;padding-bottom:6px;font-size:14px;line-height:14px;min-height:14px}.acf-field-object>.handle .row-options{visibility:hidden}.acf-field-object>.handle .row-options a{margin-right:4px}.acf-field-object>.handle .row-options a.delete-field{color:#a00}.acf-field-object>.handle .row-options a.delete-field:hover{color:red}.acf-field-object.open+.acf-field-object{border-top-color:#e1e1e1}.acf-field-object.open>.handle{background:#2a9bd9;border:#2696d3 solid 1px;text-shadow:#268fbb 0 1px 0;color:#fff;position:relative;margin:-1px -1px 0 -1px}.acf-field-object.open>.handle a{color:#fff !important}.acf-field-object.open>.handle a:hover{text-decoration:underline !important}.acf-field-object.open>.handle .acf-icon{border-color:#fff;color:#fff}.acf-field-object.open>.handle .acf-required{color:#fff}.acf-field-object:hover>.handle .row-options,.acf-field-object.-hover>.handle .row-options{visibility:visible}.acf-field-object>.settings{display:none;width:100%}.acf-field-object>.settings>.acf-table{border:none}.acf-field-object .rule-groups{margin-top:20px}.rule-groups h4{margin:3px 0}.rule-groups .rule-group{margin:0 0 5px}.rule-groups .rule-group h4{margin:0 0 3px}.rule-groups .rule-group td.param{width:35%}.rule-groups .rule-group td.operator{width:20%}.rule-groups .rule-group td.add{width:40px}.rule-groups .rule-group td.remove{width:28px;vertical-align:middle}.rule-groups .rule-group td.remove a{visibility:hidden}.rule-groups .rule-group tr:hover td.remove a{visibility:visible}.rule-groups .rule-group select:empty{background:#f8f8f8}.rule-groups:not(.rule-groups-multiple) .rule-group:first-child tr:first-child td.remove a{visibility:hidden !important}#acf-field-group-options tr[data-name=hide_on_screen] li{float:left;width:33%}@media(max-width: 1100px){#acf-field-group-options tr[data-name=hide_on_screen] li{width:50%}}table.conditional-logic-rules{background:transparent;border:0 none;border-radius:0}table.conditional-logic-rules tbody td{background:transparent;border:0 none !important;padding:5px 2px !important}.acf-field-object-tab .acf-field-setting-name,.acf-field-object-accordion .acf-field-setting-name,.acf-field-object-tab .acf-field-setting-instructions,.acf-field-object-accordion .acf-field-setting-instructions,.acf-field-object-tab .acf-field-setting-required,.acf-field-object-accordion .acf-field-setting-required,.acf-field-object-tab .acf-field-setting-warning,.acf-field-object-accordion .acf-field-setting-warning,.acf-field-object-tab .acf-field-setting-wrapper,.acf-field-object-accordion .acf-field-setting-wrapper{display:none}.acf-field-object-tab .li-field-name,.acf-field-object-accordion .li-field-name{visibility:hidden}.acf-field-object+.acf-field-object-tab:before,.acf-field-object+.acf-field-object-accordion:before{display:block;content:"";height:5px;width:100%;background:#f5f5f5;border-top:#e1e1e1 solid 1px;border-bottom:#e1e1e1 solid 1px;margin-top:-1px}.acf-admin-3-8 .acf-field-object+.acf-field-object-tab:before,.acf-admin-3-8 .acf-field-object+.acf-field-object-accordion:before{border-color:#e5e5e5}.acf-field-object-tab p:first-child,.acf-field-object-accordion p:first-child{margin:.5em 0}.acf-field-object-accordion .acf-field-setting-instructions{display:table-row}.acf-field-object-message tr[data-name=name],.acf-field-object-message tr[data-name=instructions],.acf-field-object-message tr[data-name=required]{display:none !important}.acf-field-object-message .li-field-name{visibility:hidden}.acf-field-object-message textarea{height:175px !important}.acf-field-object-separator tr[data-name=name],.acf-field-object-separator tr[data-name=instructions],.acf-field-object-separator tr[data-name=required]{display:none !important}.acf-field-object-date-picker .acf-radio-list li,.acf-field-object-time-picker .acf-radio-list li,.acf-field-object-date-time-picker .acf-radio-list li{line-height:25px}.acf-field-object-date-picker .acf-radio-list span,.acf-field-object-time-picker .acf-radio-list span,.acf-field-object-date-time-picker .acf-radio-list span{display:inline-block;min-width:10em}.acf-field-object-date-picker .acf-radio-list input[type=text],.acf-field-object-time-picker .acf-radio-list input[type=text],.acf-field-object-date-time-picker .acf-radio-list input[type=text]{width:100px}.acf-field-object-date-time-picker .acf-radio-list span{min-width:15em}.acf-field-object-date-time-picker .acf-radio-list input[type=text]{width:200px}#slugdiv .inside{padding:12px;margin:0}#slugdiv input[type=text]{width:100%;height:28px;font-size:14px}html[dir=rtl] .acf-field-object.open>.handle{margin:-1px -1px 0}html[dir=rtl] .acf-field-object.open>.handle .acf-icon{float:right}html[dir=rtl] .acf-field-object.open>.handle .li-field-order{padding-left:0 !important;padding-right:15px !important}@media only screen and (max-width: 850px){tr.acf-field,td.acf-label,td.acf-input{display:block !important;width:auto !important;border:0 none !important}tr.acf-field{border-top:#ededed solid 1px !important;margin-bottom:0 !important}td.acf-label{background:transparent !important;padding-bottom:0 !important}}
This diff could not be displayed because it is too large.
/*!******************************************************************************************************************************************************************************************************************************!*\
!*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./src/advanced-custom-fields-pro/assets/src/sass/pro/acf-pro-field-group.scss ***!
\******************************************************************************************************************************************************************************************************************************/
/*--------------------------------------------------------------------------------------------
*
* Vars
*
*--------------------------------------------------------------------------------------------*/
/* colors */
/* acf-field */
/* responsive */
/*--------------------------------------------------------------------------------------------
*
* Mixins
*
*--------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------
*
* Flexible Content
*
*---------------------------------------------------------------------------------------------*/
.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,
.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min {
float: left;
width: 33%;
padding-right: 10px;
}
.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;
}
/*---------------------------------------------------------------------------------------------
*
* Clone
*
*---------------------------------------------------------------------------------------------*/
.acf-field-object-clone {
/* group */
/* seamless */
}
.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;
}
/*# sourceMappingURL=acf-pro-field-group.css.map*/
\ No newline at end of file
{"version":3,"file":"acf-pro-field-group.css","mappings":";;;AAAA;;;;8FAAA;AAMA;AAOA;AAQA;ACrBA;;;;8FAAA;ACAA;;;;+FAAA;AASC;EACC;EACA;ACUF;ADRE;EACC;EACA;ACUH;ADPE;;EAEC;EACA;EACA;ACSH;ADNE;;;EAGC;ACQH;ADHC;EACC;ACKF;ADHE;EACC;ACKH;ADFE;EACC;EACA;EACA;ACIH;ADEG;EACC;ACAJ;;ADMA;;;;+FAAA;AAMA;EAEC;EAOA;ACXD;ADcE;;;;EAIC;ACZH,C","sources":["webpack://advanced-custom-fields-pro/./src/advanced-custom-fields-pro/assets/src/sass/_variables.scss","webpack://advanced-custom-fields-pro/./src/advanced-custom-fields-pro/assets/src/sass/_mixins.scss","webpack://advanced-custom-fields-pro/./src/advanced-custom-fields-pro/assets/src/sass/pro/_field-group.scss","webpack://advanced-custom-fields-pro/./src/advanced-custom-fields-pro/assets/src/sass/pro/acf-pro-field-group.scss"],"sourcesContent":["/*--------------------------------------------------------------------------------------------\n*\n*\tVars\n*\n*--------------------------------------------------------------------------------------------*/\n\n/* colors */\n$acf_blue: #2a9bd9;\n$acf_notice: #2a9bd9;\n$acf_error: #d94f4f;\n$acf_success: #49ad52;\n$acf_warning: #fd8d3b;\n\n/* acf-field */\n$field_padding: 15px 12px;\n$field_padding_x: 12px;\n$field_padding_y: 15px;\n$fp: 15px 12px;\n$fy: 15px;\n$fx: 12px;\n\n/* responsive */\n$md: 880px;\n$sm: 640px;\n\n// Admin.\n$wp-card-border: #ccd0d4;\t\t\t// Card border.\n$wp-card-border-1: #d5d9dd;\t\t\t// Card inner border 1: Structural (darker).\n$wp-card-border-2: #eeeeee;\t\t\t// Card inner border 2: Fields (lighter).\n$wp-input-border: #7e8993;\t\t\t// Input border.\n\n// Admin 3.8\n$wp38-card-border: #E5E5E5;\t\t\t// Card border.\n$wp38-card-border-1: #dfdfdf;\t\t// Card inner border 1: Structural (darker).\n$wp38-card-border-2: #eeeeee;\t\t// Card inner border 2: Fields (lighter).\n$wp38-input-border: #dddddd;\t\t// Input border.","/*--------------------------------------------------------------------------------------------\n*\n* Mixins\n*\n*--------------------------------------------------------------------------------------------*/\n@mixin clearfix() {\n\t&:after {\n\t\tdisplay: block;\n\t\tclear: both;\n\t\tcontent: \"\";\n\t}\n}\n\n@mixin border-box() {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\n@mixin centered() {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n\n@mixin animate( $properties: 'all' ) {\n\t-webkit-transition: $properties 0.3s ease; // Safari 3.2+, Chrome\n -moz-transition: $properties 0.3s ease; \t// Firefox 4-15\n -o-transition: $properties 0.3s ease; \t\t// Opera 10.5–12.00\n transition: $properties 0.3s ease; \t\t// Firefox 16+, Opera 12.50+\n}\n\n@mixin rtl() {\n\thtml[dir=\"rtl\"] & {\n\t\ttext-align: right;\n\t\t@content;\n\t}\n}\n\n@mixin wp-admin( $version: '3-8' ) {\n\t.acf-admin-#{$version} & {\n\t\t@content;\n\t}\n}","/*---------------------------------------------------------------------------------------------\n*\n*\tFlexible Content\n*\t\n*---------------------------------------------------------------------------------------------*/\n\n.acf-field-setting-fc_layout {\n\t\n\t// meta\n\t.acf-fc-meta {\n\t\tmargin: 0 0 10px;\n\t\tpadding: 0;\n\t\t\n\t\tli {\n\t\t\tmargin: 0 0 10px;\n\t\t\tpadding: 0;\n\t\t}\n\t\t\n\t\t.acf-fc-meta-display,\n\t\t.acf-fc-meta-min {\n\t\t\tfloat: left;\n\t\t\twidth: 33%;\n\t\t\tpadding-right: 10px;\n\t\t}\n\t\t\n\t\t.acf-fc-meta-label .acf-input-prepend,\n\t\t.acf-fc-meta-name .acf-input-prepend,\n\t\t.acf-fc-meta-display .acf-input-prepend {\n\t\t\tmin-width: 60px;\n\t\t}\n\t}\n\t\n\t// actions\n\t.acf-fl-actions {\n\t\tvisibility: hidden;\n\t\t\n\t\t.reorder-layout {\n\t\t\tcursor: move;\n\t\t}\n\t\t\n\t\ta {\n\t\t\tpadding: 1px 0;\n\t\t\tfont-size: 13px;\n\t\t\tline-height: 20px;\n\t\t}\n\t}\n\t\n\t// hover\n\t&:hover, &.-hover {\n\t\t .acf-fl-actions {\n\t\t \tvisibility: visible;\n\t\t }\n\t}\n}\n\n\n/*---------------------------------------------------------------------------------------------\n*\n*\tClone\n*\t\n*---------------------------------------------------------------------------------------------*/\n\n.acf-field-object-clone {\n\t\n\t/* group */\n\t&[data-display=\"group\"] {\n\t\t\n\t\t\n\t}\n\t\n\t\n\t/* seamless */\n\t&[data-display=\"seamless\"] {\n\t\t\n\t\t.acf-field-setting-instructions,\n\t\t.acf-field-setting-layout,\n\t\t.acf-field-setting-wrapper,\n\t\t.acf-field-setting-conditional_logic {\n\t\t\tdisplay: none;\n\t\t}\n\t\t\n\t}\n\t\n}","/*--------------------------------------------------------------------------------------------\n*\n*\tVars\n*\n*--------------------------------------------------------------------------------------------*/\n/* colors */\n/* acf-field */\n/* responsive */\n/*--------------------------------------------------------------------------------------------\n*\n* Mixins\n*\n*--------------------------------------------------------------------------------------------*/\n/*---------------------------------------------------------------------------------------------\n*\n*\tFlexible Content\n*\t\n*---------------------------------------------------------------------------------------------*/\n.acf-field-setting-fc_layout .acf-fc-meta {\n margin: 0 0 10px;\n padding: 0;\n}\n.acf-field-setting-fc_layout .acf-fc-meta li {\n margin: 0 0 10px;\n padding: 0;\n}\n.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display,\n.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min {\n float: left;\n width: 33%;\n padding-right: 10px;\n}\n.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-label .acf-input-prepend,\n.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-name .acf-input-prepend,\n.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-display .acf-input-prepend {\n min-width: 60px;\n}\n.acf-field-setting-fc_layout .acf-fl-actions {\n visibility: hidden;\n}\n.acf-field-setting-fc_layout .acf-fl-actions .reorder-layout {\n cursor: move;\n}\n.acf-field-setting-fc_layout .acf-fl-actions a {\n padding: 1px 0;\n font-size: 13px;\n line-height: 20px;\n}\n.acf-field-setting-fc_layout:hover .acf-fl-actions, .acf-field-setting-fc_layout.-hover .acf-fl-actions {\n visibility: visible;\n}\n\n/*---------------------------------------------------------------------------------------------\n*\n*\tClone\n*\t\n*---------------------------------------------------------------------------------------------*/\n.acf-field-object-clone {\n /* group */\n /* seamless */\n}\n.acf-field-object-clone[data-display=seamless] .acf-field-setting-instructions,\n.acf-field-object-clone[data-display=seamless] .acf-field-setting-layout,\n.acf-field-object-clone[data-display=seamless] .acf-field-setting-wrapper,\n.acf-field-object-clone[data-display=seamless] .acf-field-setting-conditional_logic {\n display: none;\n}"],"names":[],"sourceRoot":""}
\ No newline at end of file
.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,.acf-field-setting-fc_layout .acf-fc-meta .acf-fc-meta-min{float:left;width:33%;padding-right:10px}.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}
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
!function(){var e={436:function(){!function(e){var t=acf.FieldSetting.extend({type:"clone",name:"display",render:function(){var e=this.field.val();this.$fieldObject.attr("data-display",e)}});acf.registerFieldSetting(t);var i=acf.FieldSetting.extend({type:"clone",name:"prefix_label",render:function(){var e="";this.field.val()&&(e=this.fieldObject.prop("label")+" "),this.$("code").html(e+"%field_label%")}});acf.registerFieldSetting(i);var a=acf.FieldSetting.extend({type:"clone",name:"prefix_name",render:function(){var e="";this.field.val()&&(e=this.fieldObject.prop("name")+"_"),this.$("code").html(e+"%field_name%")}});acf.registerFieldSetting(a),new acf.Model({filters:{select2_args:"select2Args"},select2Args:function(e,t,i,a,l){return"acf/fields/clone/query"==i.ajaxAction&&(e.closeOnSelect=!1,l.data.ajaxData=this.ajaxData),e},ajaxData:function(t){return t.fields={},acf.getFieldObjects().map((function(e){t.fields[e.prop("key")]={key:e.prop("key"),type:e.prop("type"),label:e.prop("label"),ancestors:e.getParents().length}})),t.title=e("#title").val(),t}})}(jQuery)},309:function(){var e,t;e=jQuery,t=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"},$input:function(t){return e("#"+this.getInputId()+"-"+t)},$list:function(){return this.$(".acf-field-list:first")},getInputId:function(){return this.fieldObject.getInputId()+"-layouts-"+this.field.get("id")},getFields:function(){return acf.getFieldObjects({parent:this.$el})},getChildren:function(){return acf.getFieldObjects({list:this.$list()})},initialize:function(){var e=this.$el.parent();e.hasClass("ui-sortable")||e.sortable({items:"> .acf-field-setting-fc_layout",handle:".reorder-layout",forceHelperSize:!0,forcePlaceholderSize:!0,scroll:!0,stop:this.proxy((function(e,t){this.fieldObject.save()}))}),this.updateFieldLayouts()},updateFieldLayouts:function(){this.getChildren().map(this.updateFieldLayout,this)},updateFieldLayout:function(e){e.prop("parent_layout",this.get("id"))},onChangeLabel:function(e,t){var i=t.val(),a=this.$input("name");""==a.val()&&acf.val(a,acf.strSanitize(i))},onClickAdd:function(e,t){var i=this.get("id"),a=acf.uniqid("layout_");$layout=acf.duplicate({$el:this.$el,search:i,replace:a,after:function(e,t){var i=t.find(".acf-field-list:first");i.children(".acf-field-object").remove(),i.addClass("-empty"),t.find(".acf-fc-meta input").val("")}}),acf.getFieldSetting($layout).$input("key").val(a),this.fieldObject.save()},onClickDuplicate:function(e,t){var i=this.get("id"),a=acf.uniqid("layout_");$layout=acf.duplicate({$el:this.$el,search:i,replace:a});var l=acf.getFieldObjects({parent:$layout});l.length&&(l.map((function(e){e.wipe(),e.updateParent()})),acf.doAction("duplicate_field_objects",l,this.fieldObject,this.fieldObject)),acf.getFieldSetting($layout).$input("key").val(a),this.fieldObject.save()},onClickDelete:function(e,t){if(e.shiftKey)return this.delete();this.$el.addClass("-hover"),acf.newTooltip({confirmRemove:!0,target:t,context:this,confirm:function(){this.delete()},cancel:function(){this.$el.removeClass("-hover")}})},delete:function(){if(!this.$el.siblings(".acf-field-setting-fc_layout").length)return alert(acf.__("Flexible Content requires at least 1 layout")),!1;this.getFields().map((function(e){e.delete({animate:!1})})),acf.remove(this.$el),this.fieldObject.save()}}),acf.registerFieldSetting(t),new acf.Model({actions:{sortstop_field_object:"updateParentLayout",change_field_object_parent:"updateParentLayout"},updateParentLayout:function(e){var t=e.getParent();if(t&&"flexible_content"===t.prop("type")){var i=e.$el.closest(".acf-field-setting-fc_layout"),a=acf.getFieldSetting(i);e.has("parent_layout")||e.prop("parent_layout",0),e.prop("parent_layout",a.get("id"))}else e.prop("parent_layout",null)}})},166:function(){var e;jQuery,e=acf.FieldSetting.extend({type:"repeater",name:"collapsed",events:{"focus select":"onFocus"},onFocus:function(e,t){var i=t,a=[];a.push({label:i.find('option[value=""]').text(),value:""});var l=this.fieldObject.$(".acf-field-list:first");acf.getFieldObjects({list:l}).map((function(e){a.push({label:e.prop("label"),value:e.prop("key")})})),acf.renderSelect(i,a)}}),acf.registerFieldSetting(e)}},t={};function i(a){var l=t[a];if(void 0!==l)return l.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,i),n.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";i(166),i(309),i(436)}()}();
\ No newline at end of file
<svg width="16" height="14" viewBox="0 0 16 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.0007 5.3894H1.03223" stroke="#425FDD" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M8.8642 12.6272C8.4484 13.0748 7.74042 13.1294 7.26844 12.7363C7.22349 12.6927 7.17854 12.6599 7.14482 12.6162L1.27873 6.04436H1.2776C0.929234 5.6513 0.906759 5.08353 1.22142 4.66863L3.70495 1.43674C3.90723 1.15286 4.24437 1 4.60397 1H11.3466C11.695 1 12.0321 1.15286 12.2456 1.43674L14.7404 4.65771C15.0551 5.0617 15.0326 5.62946 14.6842 6.02253L8.8642 12.6272Z" stroke="#425FDD" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.12207 1.15283L7.83052 12.9885" stroke="#425FDD" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.9096 1.15283L8.24609 12.9776" stroke="#425FDD" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
/**!
* wp-color-picker-alpha
*
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
* Only run in input and is defined data alpha in true
*
* Version: 3.0.0
* https://github.com/kallookoo/wp-color-picker-alpha
* Licensed under the GPLv2 license or later.
*/
! ( function ( e, a ) {
var l,
o = { version: 300 };
if (
'wpColorPickerAlpha' in window &&
'version' in window.wpColorPickerAlpha
) {
var t = parseInt( window.wpColorPickerAlpha.version, 10 );
if ( ! isNaN( t ) && o.version <= t ) return;
}
Color.fn.hasOwnProperty( 'to_s' ) ||
( ( Color.fn.to_s = function ( o ) {
'hex' === ( o = o || 'hex' ) && this._alpha < 1 && ( o = 'rgba' );
var a = '';
return (
'hex' === o
? ( a = this.toString() )
: this.error ||
( a = this.toCSS( o )
.replace( /\(\s+/, '(' )
.replace( /\s+\)/, ')' ) ),
a
);
} ),
( window.wpColorPickerAlpha = o ),
( l =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==' ),
e.widget( 'a8c.iris', e.a8c.iris, {
alphaOptions: { alphaEnabled: ! 1 },
_getColor: function ( o ) {
return (
o === a && ( o = this._color ),
this.alphaOptions.alphaEnabled
? ( ( o = o.to_s( this.alphaOptions.alphaColorType ) ),
this.alphaOptions.alphaColorWithSpace ||
( o = o.replace( /\s+/g, '' ) ),
o )
: o.toString()
);
},
_create: function () {
try {
this.alphaOptions = this.element.wpColorPicker(
'instance'
).alphaOptions;
} catch ( o ) {}
e.extend( {}, this.alphaOptions, {
alphaEnabled: ! 1,
alphaCustomWidth: 130,
alphaReset: ! 1,
alphaColorType: 'hex',
alphaColorWithSpace: ! 1,
} ),
this._super();
},
_addInputListeners: function ( i ) {
function o( o ) {
var a = i.val(),
t = new Color( a ),
a = a.replace( /^(#|(rgb|hsl)a?)/, '' ),
r = l.alphaOptions.alphaColorType;
i.removeClass( 'iris-error' ),
t.error
? '' !== a && i.addClass( 'iris-error' )
: ( 'hex' === r &&
'keyup' === o.type &&
a.match( /^[0-9a-fA-F]{3}$/ ) ) ||
( t.toIEOctoHex() !== l._color.toIEOctoHex() &&
l._setOption( 'color', l._getColor( t ) ) );
}
var l = this;
i.on( 'change', o ).on( 'keyup', l._debounce( o, 100 ) ),
l.options.hide &&
i.one( 'focus', function () {
l.show();
} );
},
_initControls: function () {
var t, o, a, r;
this._super(),
this.alphaOptions.alphaEnabled &&
( ( a = ( o = ( t = this ).controls.strip.clone(
! 1,
! 1
) ).find( '.iris-slider-offset' ) ),
( r = { stripAlpha: o, stripAlphaSlider: a } ),
o.addClass( 'iris-strip-alpha' ),
a.addClass( 'iris-slider-offset-alpha' ),
o.appendTo( t.picker.find( '.iris-picker-inner' ) ),
e.each( r, function ( o, a ) {
t.controls[ o ] = a;
} ),
t.controls.stripAlphaSlider.slider( {
orientation: 'vertical',
min: 0,
max: 100,
step: 1,
value: parseInt( 100 * t._color._alpha ),
slide: function ( o, a ) {
( t.active = 'strip' ),
( t._color._alpha = parseFloat(
a.value / 100
) ),
t._change.apply( t, arguments );
},
} ) );
},
_dimensions: function ( o ) {
if ( ( this._super( o ), this.alphaOptions.alphaEnabled ) ) {
for (
var a = this,
t = a.options,
r = a.controls.square,
o = a.picker.find( '.iris-strip' ),
i = Math.round(
a.picker.outerWidth( ! 0 ) -
( t.border ? 22 : 0 )
),
l = Math.round( r.outerWidth() ),
e = Math.round( ( i - l ) / 2 ),
s = Math.round( e / 2 ),
n = Math.round( l + 2 * e + 2 * s );
i < n;
)
( e = Math.round( e - 2 ) ),
( s = Math.round( s - 1 ) ),
( n = Math.round( l + 2 * e + 2 * s ) );
r.css( 'margin', '0' ),
o.width( e ).css( 'margin-left', s + 'px' );
}
},
_change: function () {
var o,
a,
t,
r = this,
i = r.active;
r._super(),
r.alphaOptions.alphaEnabled &&
( ( o = r.controls ),
( a = parseInt( 100 * r._color._alpha ) ),
( t = [
'rgb(' +
( t = r._color.toRgb() ).r +
',' +
t.g +
',' +
t.b +
') 0%',
'rgba(' + t.r + ',' + t.g + ',' + t.b + ', 0) 100%',
] ),
r.picker
.closest( '.wp-picker-container' )
.find( '.wp-color-result' ),
( r.options.color = r._getColor() ),
o.stripAlpha.css( {
background:
'linear-gradient(to bottom, ' +
t.join( ', ' ) +
'), url(' +
l +
')',
} ),
i && o.stripAlphaSlider.slider( 'value', a ),
r._color.error ||
r.element
.removeClass( 'iris-error' )
.val( r.options.color ),
r.picker
.find( '.iris-palette-container' )
.on( 'click.palette', '.iris-palette', function () {
var o = e( this ).data( 'color' );
r.alphaOptions.alphaReset &&
( ( r._color._alpha = 1 ),
( o = r._getColor() ) ),
r._setOption( 'color', o );
} ) );
},
_paintDimension: function ( o, a ) {
var t = this,
r = ! 1;
t.alphaOptions.alphaEnabled &&
'strip' === a &&
( ( r = t._color ),
( t._color = new Color( r.toString() ) ),
( t.hue = t._color.h() ) ),
t._super( o, a ),
r && ( t._color = r );
},
_setOption: function ( o, a ) {
var t = this;
if ( 'color' !== o || ! t.alphaOptions.alphaEnabled )
return t._super( o, a );
( a = '' + a ),
( newColor = new Color( a ).setHSpace( t.options.mode ) ),
newColor.error ||
t._getColor( newColor ) === t._getColor() ||
( ( t._color = newColor ),
( t.options.color = t._getColor() ),
( t.active = 'external' ),
t._change() );
},
color: function ( o ) {
return ! 0 === o
? this._color.clone()
: o === a
? this._getColor()
: void this.option( 'color', o );
},
} ),
e.widget( 'wp.wpColorPicker', e.wp.wpColorPicker, {
alphaOptions: { alphaEnabled: ! 1 },
_getAlphaOptions: function () {
var r = this.element,
o = r.data( 'type' ) || this.options.type,
i = r.data( 'defaultColor' ) || r.val(),
l = {
alphaEnabled: r.data( 'alphaEnabled' ) || ! 1,
alphaCustomWidth: 130,
alphaReset: ! 1,
alphaColorType: 'rgb',
alphaColorWithSpace: ! 1,
};
return (
l.alphaEnabled &&
( l.alphaEnabled = r.is( 'input' ) && 'full' === o ),
l.alphaEnabled &&
( ( l.alphaColorWithSpace = i && i.match( /\s/ ) ),
e.each( l, function ( o, a ) {
var t = r.data( o ) || a;
switch ( o ) {
case 'alphaCustomWidth':
( t = t ? parseInt( t, 10 ) : 0 ),
( t = isNaN( t ) ? a : t );
break;
case 'alphaColorType':
t.match( /^(hex|(rgb|hsl)a?)$/ ) ||
( t =
i && i.match( /^#/ )
? 'hex'
: i && i.match( /^hsla?/ )
? 'hsl'
: a );
break;
default:
t = !! t;
}
l[ o ] = t;
} ) ),
l
);
},
_create: function () {
e.support.iris &&
( ( this.alphaOptions = this._getAlphaOptions() ),
this._super() );
},
_addListeners: function () {
if ( ! this.alphaOptions.alphaEnabled ) return this._super();
var t = this,
r = t.element,
i = t.toggler.is( 'a' );
( this.alphaOptions.defaultWidth = r.width() ),
this.alphaOptions.alphaCustomWidth &&
r.width(
parseInt(
this.alphaOptions.defaultWidth +
this.alphaOptions.alphaCustomWidth,
10
)
),
t.toggler.css( {
position: 'relative',
'background-image': 'url(' + l + ')',
} ),
i
? t.toggler.html( '<span class="color-alpha" />' )
: t.toggler.append( '<span class="color-alpha" />' ),
( t.colorAlpha = t.toggler.find( 'span.color-alpha' ).css( {
width: '30px',
height: '100%',
position: 'absolute',
top: 0,
'background-color': r.val(),
} ) ),
'ltr' === t.colorAlpha.css( 'direction' )
? t.colorAlpha.css( {
'border-bottom-left-radius': '2px',
'border-top-left-radius': '2px',
left: 0,
} )
: t.colorAlpha.css( {
'border-bottom-right-radius': '2px',
'border-top-right-radius': '2px',
right: 0,
} ),
r.iris( {
change: function ( o, a ) {
t.colorAlpha.css( {
'background-color': a.color.to_s(
t.alphaOptions.alphaColorType
),
} ),
e.isFunction( t.options.change ) &&
t.options.change.call( this, o, a );
},
} ),
t.wrap.on( 'click.wpcolorpicker', function ( o ) {
o.stopPropagation();
} ),
t.toggler.click( function () {
t.toggler.hasClass( 'wp-picker-open' )
? t.close()
: t.open();
} ),
r.change( function ( o ) {
var a = e( this ).val();
( r.hasClass( 'iris-error' ) ||
'' === a ||
a.match( /^(#|(rgb|hsl)a?)$/ ) ) &&
( i && t.toggler.removeAttr( 'style' ),
t.colorAlpha.css( 'background-color', '' ),
e.isFunction( t.options.clear ) &&
t.options.clear.call( this, o ) );
} ),
t.button.click( function ( o ) {
e( this ).hasClass( 'wp-picker-default' )
? r.val( t.options.defaultColor ).change()
: e( this ).hasClass( 'wp-picker-clear' ) &&
( r.val( '' ),
i && t.toggler.removeAttr( 'style' ),
t.colorAlpha.css( 'background-color', '' ),
e.isFunction( t.options.clear ) &&
t.options.clear.call( this, o ),
r.trigger( 'change' ) );
} );
},
} ) );
} )( jQuery );
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { float: left; clear:left; padding: 0 0 0 5px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 40%; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-div .ui_tpicker_unit_hide{ display: none; }
.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input { background: none; color: inherit; border: none; outline: none; border-bottom: solid 1px #555; width: 95%; }
.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus { border-bottom-color: #aaa; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; padding: 0 5px 0 0; }
.ui-timepicker-rtl dl dt{ float: right; clear: right; }
.ui-timepicker-rtl dl dd { margin: 0 40% 10px 10px; }
/* Shortened version style */
.ui-timepicker-div.ui-timepicker-oneLine { padding-right: 2px; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,
.ui-timepicker-div.ui-timepicker-oneLine dt { display: none; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label { display: block; padding-top: 2px; }
.ui-timepicker-div.ui-timepicker-oneLine dl { text-align: right; }
.ui-timepicker-div.ui-timepicker-oneLine dl dd,
.ui-timepicker-div.ui-timepicker-oneLine dl dd > div { display:inline-block; margin:0; }
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before { content:':'; display:inline-block; }
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,
.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before { content:'.'; display:inline-block; }
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,
.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{ display: none; }
\ No newline at end of file
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20
* http://trentrichardson.com/examples/timepicker
* Copyright (c) 2016 Trent Richardson; Licensed MIT */
.ui-timepicker-div .ui-widget-header{margin-bottom:8px}.ui-timepicker-div dl{text-align:left}.ui-timepicker-div dl dt{float:left;clear:left;padding:0 0 0 5px}.ui-timepicker-div dl dd{margin:0 10px 10px 40%}.ui-timepicker-div td{font-size:90%}.ui-tpicker-grid-label{background:0 0;border:0;margin:0;padding:0}.ui-timepicker-div .ui_tpicker_unit_hide{display:none}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input{background:0 0;color:inherit;border:0;outline:0;border-bottom:solid 1px #555;width:95%}.ui-timepicker-div .ui_tpicker_time .ui_tpicker_time_input:focus{border-bottom-color:#aaa}.ui-timepicker-rtl{direction:rtl}.ui-timepicker-rtl dl{text-align:right;padding:0 5px 0 0}.ui-timepicker-rtl dl dt{float:right;clear:right}.ui-timepicker-rtl dl dd{margin:0 40% 10px 10px}.ui-timepicker-div.ui-timepicker-oneLine{padding-right:2px}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time,.ui-timepicker-div.ui-timepicker-oneLine dt{display:none}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_time_label{display:block;padding-top:2px}.ui-timepicker-div.ui-timepicker-oneLine dl{text-align:right}.ui-timepicker-div.ui-timepicker-oneLine dl dd,.ui-timepicker-div.ui-timepicker-oneLine dl dd>div{display:inline-block;margin:0}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_minute:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_second:before{content:':';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_millisec:before,.ui-timepicker-div.ui-timepicker-oneLine dl dd.ui_tpicker_microsec:before{content:'.';display:inline-block}.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide,.ui-timepicker-div.ui-timepicker-oneLine .ui_tpicker_unit_hide:before{display:none}
\ No newline at end of file
<?php
// Register store for form data.
acf_register_store( 'form' );
/**
* acf_set_form_data
*
* Sets data about the current form.
*
* @date 6/10/13
* @since 5.0.0
*
* @param string $name The store name.
* @param array $data Array of data to start the store with.
* @return ACF_Data
*/
function acf_set_form_data( $name = '', $data = false ) {
return acf_get_store( 'form' )->set( $name, $data );
}
/**
* acf_get_form_data
*
* Gets data about the current form.
*
* @date 6/10/13
* @since 5.0.0
*
* @param string $name The store name.
* @return mixed
*/
function acf_get_form_data( $name = '' ) {
return acf_get_store( 'form' )->get( $name );
}
/**
* acf_form_data
*
* Called within a form to set important information and render hidden inputs.
*
* @date 15/10/13
* @since 5.0.0
*
* @param void
* @return void
*/
function acf_form_data( $data = array() ) {
// Apply defaults.
$data = wp_parse_args(
$data,
array(
/** @type string The current screen (post, user, taxonomy, etc). */
'screen' => 'post',
/** @type int|string The ID of current post being edited. */
'post_id' => 0,
/** @type bool Enables AJAX validation. */
'validation' => true,
)
);
// Create nonce using screen.
$data['nonce'] = wp_create_nonce( $data['screen'] );
// Append "changed" input used within "_wp_post_revision_fields" action.
$data['changed'] = 0;
// Set data.
acf_set_form_data( $data );
// Render HTML.
?>
<div id="acf-form-data" class="acf-hidden">
<?php
// Create hidden inputs from $data
foreach ( $data as $name => $value ) {
acf_hidden_input(
array(
'id' => '_acf_' . $name,
'name' => '_acf_' . $name,
'value' => $value,
)
);
}
/**
* Fires within the #acf-form-data element to add extra HTML.
*
* @date 15/10/13
* @since 5.0.0
*
* @param array $data The form data.
*/
do_action( 'acf/form_data', $data );
do_action( 'acf/input/form_data', $data );
?>
</div>
<?php
}
/**
* acf_save_post
*
* Saves the $_POST data.
*
* @date 15/10/13
* @since 5.0.0
*
* @param int|string $post_id The post id.
* @param array $values An array of values to override $_POST.
* @return bool True if save was successful.
*/
function acf_save_post( $post_id = 0, $values = null ) {
// Override $_POST data with $values.
if ( $values !== null ) {
$_POST['acf'] = $values;
}
// Bail early if no data to save.
if ( empty( $_POST['acf'] ) ) {
return false;
}
// Set form data (useful in various filters/actions).
acf_set_form_data( 'post_id', $post_id );
// Filter $_POST data for users without the 'unfiltered_html' capability.
if ( ! acf_allow_unfiltered_html() ) {
$_POST['acf'] = wp_kses_post_deep( $_POST['acf'] );
}
// Do generic action.
do_action( 'acf/save_post', $post_id );
// Return true.
return true;
}
/**
* _acf_do_save_post
*
* Private function hooked into 'acf/save_post' to actually save the $_POST data.
* This allows developers to hook in before and after ACF has actually saved the data.
*
* @date 11/1/19
* @since 5.7.10
*
* @param int|string $post_id The post id.
* @return void
*/
function _acf_do_save_post( $post_id = 0 ) {
// Check and update $_POST data.
if ( $_POST['acf'] ) {
acf_update_values( $_POST['acf'], $post_id );
}
}
// Run during generic action.
add_action( 'acf/save_post', '_acf_do_save_post' );
<?php
// Register store.
acf_register_store( 'hook-variations' );
/**
* acf_add_filter_variations
*
* Registers variations for the given filter.
*
* @date 26/1/19
* @since 5.7.11
*
* @param string $filter The filter name.
* @param array $variations An array variation keys.
* @param int $index The param index to find variation values.
* @return void
*/
function acf_add_filter_variations( $filter = '', $variations = array(), $index = 0 ) {
// Store replacement data.
acf_get_store( 'hook-variations' )->set(
$filter,
array(
'type' => 'filter',
'variations' => $variations,
'index' => $index,
)
);
// Add generic handler.
// Use a priotiry of 10, and accepted args of 10 (ignored by WP).
add_filter( $filter, '_acf_apply_hook_variations', 10, 10 );
}
/**
* acf_add_action_variations
*
* Registers variations for the given action.
*
* @date 26/1/19
* @since 5.7.11
*
* @param string $action The action name.
* @param array $variations An array variation keys.
* @param int $index The param index to find variation values.
* @return void
*/
function acf_add_action_variations( $action = '', $variations = array(), $index = 0 ) {
// Store replacement data.
acf_get_store( 'hook-variations' )->set(
$action,
array(
'type' => 'action',
'variations' => $variations,
'index' => $index,
)
);
// Add generic handler.
// Use a priotiry of 10, and accepted args of 10 (ignored by WP).
add_action( $action, '_acf_apply_hook_variations', 10, 10 );
}
/**
* _acf_apply_hook_variations
*
* Applies hook variations during apply_filters() or do_action().
*
* @date 25/1/19
* @since 5.7.11
*
* @param mixed
* @return mixed
*/
function _acf_apply_hook_variations() {
// Get current filter.
$filter = current_filter();
// Get args provided.
$args = func_get_args();
// Get variation information.
$variations = acf_get_store( 'hook-variations' )->get( $filter );
$index = $variations['index'];
$type = $variations['type'];
$variations = $variations['variations'];
// Find field in args using index.
$field = $args[ $index ];
// Loop over variations and apply filters.
foreach ( $variations as $variation ) {
// Get value from field.
// First look for "backup" value ("_name", "_key").
if ( isset( $field[ "_$variation" ] ) ) {
$value = $field[ "_$variation" ];
} elseif ( isset( $field[ $variation ] ) ) {
$value = $field[ $variation ];
} else {
continue;
}
// Apply filters.
if ( $type === 'filter' ) {
$args[0] = apply_filters_ref_array( "$filter/$variation=$value", $args );
// Or do action.
} else {
do_action_ref_array( "$filter/$variation=$value", $args );
}
}
// Return first arg.
return $args[0];
}
// Register store.
acf_register_store( 'deprecated-hooks' );
/**
* acf_add_deprecated_filter
*
* Registers a deprecated filter to run during the replacement.
*
* @date 25/1/19
* @since 5.7.11
*
* @param string $deprecated The deprecated hook.
* @param string $version The version this hook was deprecated.
* @param string $replacement The replacement hook.
* @return void
*/
function acf_add_deprecated_filter( $deprecated, $version, $replacement ) {
// Store replacement data.
acf_get_store( 'deprecated-hooks' )->append(
array(
'type' => 'filter',
'deprecated' => $deprecated,
'replacement' => $replacement,
'version' => $version,
)
);
// Add generic handler.
// Use a priority of 10, and accepted args of 10 (ignored by WP).
add_filter( $replacement, '_acf_apply_deprecated_hook', 10, 10 );
}
/**
* acf_add_deprecated_action
*
* Registers a deprecated action to run during the replacement.
*
* @date 25/1/19
* @since 5.7.11
*
* @param string $deprecated The deprecated hook.
* @param string $version The version this hook was deprecated.
* @param string $replacement The replacement hook.
* @return void
*/
function acf_add_deprecated_action( $deprecated, $version, $replacement ) {
// Store replacement data.
acf_get_store( 'deprecated-hooks' )->append(
array(
'type' => 'action',
'deprecated' => $deprecated,
'replacement' => $replacement,
'version' => $version,
)
);
// Add generic handler.
// Use a priority of 10, and accepted args of 10 (ignored by WP).
add_filter( $replacement, '_acf_apply_deprecated_hook', 10, 10 );
}
/**
* Applies a deprecated filter during apply_filters() or do_action().
*
* @date 25/1/19
* @since 5.7.11
*
* @param mixed
* @return mixed
*/
function _acf_apply_deprecated_hook() {
// Get current hook.
$current_hook = current_filter();
// Get args provided.
$args = func_get_args();
// Get deprecated items for this hook.
$deprecated_hooks = acf_get_store( 'deprecated-hooks' )->query( array( 'replacement' => $current_hook ) );
// Loop over results.
foreach ( $deprecated_hooks as $hook ) {
// Check if anyone is hooked into this deprecated hook.
if ( isset( $hook['deprecated'] ) && has_filter( $hook['deprecated'] ) ) {
// Log warning.
// _deprecated_hook( $deprecated, $version, $hook );
// Apply the item/do the action.
if ( $hook['type'] === 'filter' ) {
$args[0] = apply_filters_ref_array( $hook['deprecated'], $args );
} else {
do_action_ref_array( $hook['deprecated'], $args );
}
}
}
// Return first arg.
return $args[0];
}
<?php
/**
* acf_filter_attrs
*
* Filters out empty attrs from the provided array.
*
* @date 11/6/19
* @since 5.8.1
*
* @param array $attrs The array of attrs.
* @return array
*/
function acf_filter_attrs( $attrs ) {
// Filter out empty attrs but allow "0" values.
$filtered = array_filter( $attrs, 'acf_not_empty' );
// Correct specific attributes (required="required").
foreach ( array( 'required', 'readonly', 'disabled', 'multiple' ) as $key ) {
unset( $filtered[ $key ] );
if ( ! empty( $attrs[ $key ] ) ) {
$filtered[ $key ] = $key;
}
}
return $filtered;
}
/**
* acf_esc_attrs
*
* Generated valid HTML from an array of attrs.
*
* @date 11/6/19
* @since 5.8.1
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_esc_attrs( $attrs ) {
$html = '';
// Loop over attrs and validate data types.
foreach ( $attrs as $k => $v ) {
// String (but don't trim value).
if ( is_string( $v ) && ( $k !== 'value' ) ) {
$v = trim( $v );
// Boolean
} elseif ( is_bool( $v ) ) {
$v = $v ? 1 : 0;
// Object
} elseif ( is_array( $v ) || is_object( $v ) ) {
$v = json_encode( $v );
}
// Generate HTML.
$html .= sprintf( ' %s="%s"', esc_attr( $k ), esc_attr( $v ) );
}
// Return trimmed.
return trim( $html );
}
/**
* Sanitizes text content and strips out disallowed HTML.
*
* This function emulates `wp_kses_post()` with a context of "acf" for extensibility.
*
* @date 16/4/21
* @since 5.9.6
*
* @param string $string
* @return string
*/
function acf_esc_html( $string = '' ) {
return wp_kses( (string) $string, 'acf' );
}
/**
* Private callback for the "wp_kses_allowed_html" filter used to return allowed HTML for "acf" context.
*
* @date 16/4/21
* @since 5.9.6
*
* @param array $tags An array of allowed tags.
* @param string $context The context name.
* @return array.
*/
function _acf_kses_allowed_html( $tags, $context ) {
global $allowedposttags;
if ( $context === 'acf' ) {
return $allowedposttags;
}
return $tags;
}
add_filter( 'wp_kses_allowed_html', '_acf_kses_allowed_html', 0, 2 );
/**
* acf_html_input
*
* Returns the HTML of an input.
*
* @date 13/6/19
* @since 5.8.1
*
* @param array $attrs The array of attrs.
* @return string
*/
// function acf_html_input( $attrs = array() ) {
// return sprintf( '<input %s/>', acf_esc_attrs($attrs) );
// }
/**
* acf_hidden_input
*
* Renders the HTML of a hidden input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_hidden_input( $attrs = array() ) {
echo acf_get_hidden_input( $attrs );
}
/**
* acf_get_hidden_input
*
* Returns the HTML of a hidden input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_hidden_input( $attrs = array() ) {
return sprintf( '<input type="hidden" %s/>', acf_esc_attrs( $attrs ) );
}
/**
* acf_text_input
*
* Renders the HTML of a text input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_text_input( $attrs = array() ) {
echo acf_get_text_input( $attrs );
}
/**
* acf_get_text_input
*
* Returns the HTML of a text input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_text_input( $attrs = array() ) {
$attrs = wp_parse_args(
$attrs,
array(
'type' => 'text',
)
);
if ( isset( $attrs['value'] ) && is_string( $attrs['value'] ) ) {
$attrs['value'] = htmlspecialchars( $attrs['value'] );
}
return sprintf( '<input %s/>', acf_esc_attrs( $attrs ) );
}
/**
* acf_file_input
*
* Renders the HTML of a file input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_file_input( $attrs = array() ) {
echo acf_get_file_input( $attrs );
}
/**
* acf_get_file_input
*
* Returns the HTML of a file input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_file_input( $attrs = array() ) {
return sprintf( '<input type="file" %s/>', acf_esc_attrs( $attrs ) );
}
/**
* acf_textarea_input
*
* Renders the HTML of a textarea input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_textarea_input( $attrs = array() ) {
echo acf_get_textarea_input( $attrs );
}
/**
* acf_get_textarea_input
*
* Returns the HTML of a textarea input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_textarea_input( $attrs = array() ) {
$value = '';
if ( isset( $attrs['value'] ) ) {
$value = $attrs['value'];
unset( $attrs['value'] );
}
return sprintf( '<textarea %s>%s</textarea>', acf_esc_attrs( $attrs ), esc_textarea( $value ) );
}
/**
* acf_checkbox_input
*
* Renders the HTML of a checkbox input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_checkbox_input( $attrs = array() ) {
echo acf_get_checkbox_input( $attrs );
}
/**
* acf_get_checkbox_input
*
* Returns the HTML of a checkbox input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_checkbox_input( $attrs = array() ) {
// Allow radio or checkbox type.
$attrs = wp_parse_args(
$attrs,
array(
'type' => 'checkbox',
)
);
// Get label.
$label = '';
if ( isset( $attrs['label'] ) ) {
$label = $attrs['label'];
unset( $attrs['label'] );
}
// Render.
$checked = isset( $attrs['checked'] );
return '<label' . ( $checked ? ' class="selected"' : '' ) . '><input ' . acf_esc_attr( $attrs ) . '/> ' . acf_esc_html( $label ) . '</label>';
}
/**
* acf_radio_input
*
* Renders the HTML of a radio input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_radio_input( $attrs = array() ) {
echo acf_get_radio_input( $attrs );
}
/**
* acf_get_radio_input
*
* Returns the HTML of a radio input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_radio_input( $attrs = array() ) {
$attrs['type'] = 'radio';
return acf_get_checkbox_input( $attrs );
}
/**
* acf_select_input
*
* Renders the HTML of a select input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_select_input( $attrs = array() ) {
echo acf_get_select_input( $attrs );
}
/**
* acf_select_input
*
* Returns the HTML of a select input.
*
* @date 3/02/2014
* @since 5.0.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_get_select_input( $attrs = array() ) {
$value = (array) acf_extract_var( $attrs, 'value' );
$choices = (array) acf_extract_var( $attrs, 'choices' );
return sprintf(
'<select %s>%s</select>',
acf_esc_attrs( $attrs ),
acf_walk_select_input( $choices, $value )
);
}
/**
* acf_walk_select_input
*
* Returns the HTML of a select input's choices.
*
* @date 27/6/17
* @since 5.6.0
*
* @param array $choices The choices to walk through.
* @param array $values The selected choices.
* @param array $depth The current walk depth.
* @return string
*/
function acf_walk_select_input( $choices = array(), $values = array(), $depth = 0 ) {
$html = '';
// Sanitize values for 'selected' matching (only once).
if ( $depth == 0 ) {
$values = array_map( 'esc_attr', $values );
}
// Loop over choices and append to html.
if ( $choices ) {
foreach ( $choices as $value => $label ) {
// Multiple (optgroup)
if ( is_array( $label ) ) {
$html .= sprintf(
'<optgroup label="%s">%s</optgroup>',
esc_attr( $value ),
acf_walk_select_input( $label, $values, $depth + 1 )
);
// single (option)
} else {
$attrs = array(
'value' => $value,
);
// If is selected.
$pos = array_search( esc_attr( $value ), $values );
if ( $pos !== false ) {
$attrs['selected'] = 'selected';
$attrs['data-i'] = $pos;
}
$html .= sprintf( '<option %s>%s</option>', acf_esc_attr( $attrs ), esc_html( $label ) );
}
}
}
return $html;
}
/**
* acf_clean_atts
*
* See acf_filter_attrs().
*
* @date 3/10/17
* @since 5.6.3
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_clean_atts( $attrs ) {
return acf_filter_attrs( $attrs );
}
/**
* acf_esc_atts
*
* See acf_esc_attrs().
*
* @date 27/6/17
* @since 5.6.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_esc_atts( $attrs ) {
return acf_esc_attrs( $attrs );
}
/**
* acf_esc_attr
*
* See acf_esc_attrs().
*
* @date 13/6/19
* @since 5.8.1
* @deprecated 5.6.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_esc_attr( $attrs ) {
return acf_esc_attrs( $attrs );
}
/**
* acf_esc_attr_e
*
* See acf_esc_attrs().
*
* @date 13/6/19
* @since 5.8.1
* @deprecated 5.6.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_esc_attr_e( $attrs ) {
echo acf_esc_attrs( $attrs );
}
/**
* acf_esc_atts_e
*
* See acf_esc_attrs().
*
* @date 13/6/19
* @since 5.8.1
* @deprecated 5.6.0
*
* @param array $attrs The array of attrs.
* @return string
*/
function acf_esc_atts_e( $attrs ) {
echo acf_esc_attrs( $attrs );
}
<?php
/**
* Returns available templates for each post type.
*
* @date 29/8/17
* @since 5.6.2
*
* @param void
* @return array
*/
function acf_get_post_templates() {
// Check store.
$cache = acf_get_data( 'post_templates' );
if ( $cache !== null ) {
return $cache;
}
// Initialize templates with default placeholder for pages.
$post_templates = array();
$post_templates['page'] = array();
// Loop over post types and append their templates.
if ( method_exists( 'WP_Theme', 'get_page_templates' ) ) {
$post_types = get_post_types();
foreach ( $post_types as $post_type ) {
$templates = wp_get_theme()->get_page_templates( null, $post_type );
if ( $templates ) {
$post_templates[ $post_type ] = $templates;
}
}
}
// Update store.
acf_set_data( 'post_templates', $post_templates );
// Return templates.
return $post_templates;
}
<?php
/**
* acf_get_users
*
* Similar to the get_users() function but with extra functionality.
*
* @date 9/1/19
* @since 5.7.10
*
* @param array $args The query args.
* @return array
*/
function acf_get_users( $args = array() ) {
// Get users.
$users = get_users( $args );
// Maintain order.
if ( $users && $args['include'] ) {
// Generate order array.
$order = array();
foreach ( $users as $i => $user ) {
$order[ $i ] = array_search( $user->ID, $args['include'] );
}
// Sort results.
array_multisort( $order, $users );
}
// Return
return $users;
}
/**
* acf_get_user_result
*
* Returns a result containing "id" and "text" for the given user.
*
* @date 21/5/19
* @since 5.8.1
*
* @param WP_User $user The user object.
* @return array
*/
function acf_get_user_result( $user ) {
// Vars.
$id = $user->ID;
$text = $user->user_login;
// Add name.
if ( $user->first_name && $user->last_name ) {
$text .= " ({$user->first_name} {$user->last_name})";
} elseif ( $user->first_name ) {
$text .= " ({$user->first_name})";
}
return compact( 'id', 'text' );
}
/**
* acf_get_user_role_labels
*
* Returns an array of user roles in the format "name => label".
*
* @date 20/5/19
* @since 5.8.1
*
* @param array $roles A specific array of roles.
* @return array
*/
function acf_get_user_role_labels( $roles = array() ) {
$all_roles = wp_roles()->get_names();
// Load all roles if none provided.
if ( empty( $roles ) ) {
$roles = array_keys( $all_roles );
}
// Loop over roles and populare labels.
$lables = array();
foreach ( $roles as $role ) {
if ( isset( $all_roles[ $role ] ) ) {
$lables[ $role ] = translate_user_role( $all_roles[ $role ] );
}
}
// Return labels.
return $lables;
}
/**
* acf_allow_unfiltered_html
*
* Returns true if the current user is allowed to save unfiltered HTML.
*
* @date 9/1/19
* @since 5.7.10
*
* @param void
* @return bool
*/
function acf_allow_unfiltered_html() {
// Check capability.
$allow_unfiltered_html = current_user_can( 'unfiltered_html' );
/**
* Filters whether the current user is allowed to save unfiltered HTML.
*
* @date 9/1/19
* @since 5.7.10
*
* @param bool allow_unfiltered_html The result.
*/
return apply_filters( 'acf/allow_unfiltered_html', $allow_unfiltered_html );
}
<?php
// Globals.
global $acf_stores, $acf_instances;
// Initialize plaeholders.
$acf_stores = array();
$acf_instances = array();
/**
* acf_new_instance
*
* Creates a new instance of the given class and stores it in the instances data store.
*
* @date 9/1/19
* @since 5.7.10
*
* @param string $class The class name.
* @return object The instance.
*/
function acf_new_instance( $class = '' ) {
global $acf_instances;
return $acf_instances[ $class ] = new $class();
}
/**
* acf_get_instance
*
* Returns an instance for the given class.
*
* @date 9/1/19
* @since 5.7.10
*
* @param string $class The class name.
* @return object The instance.
*/
function acf_get_instance( $class = '' ) {
global $acf_instances;
if ( ! isset( $acf_instances[ $class ] ) ) {
$acf_instances[ $class ] = new $class();
}
return $acf_instances[ $class ];
}
/**
* acf_register_store
*
* Registers a data store.
*
* @date 9/1/19
* @since 5.7.10
*
* @param string $name The store name.
* @param array $data Array of data to start the store with.
* @return ACF_Data
*/
function acf_register_store( $name = '', $data = false ) {
// Create store.
$store = new ACF_Data( $data );
// Register store.
global $acf_stores;
$acf_stores[ $name ] = $store;
// Return store.
return $store;
}
/**
* acf_get_store
*
* Returns a data store.
*
* @date 9/1/19
* @since 5.7.10
*
* @param string $name The store name.
* @return ACF_Data
*/
function acf_get_store( $name = '' ) {
global $acf_stores;
return isset( $acf_stores[ $name ] ) ? $acf_stores[ $name ] : false;
}
/**
* acf_switch_stores
*
* Triggered when switching between sites on a multisite installation.
*
* @date 13/2/19
* @since 5.7.11
*
* @param int $site_id New blog ID.
* @param int prev_blog_id Prev blog ID.
* @return void
*/
function acf_switch_stores( $site_id, $prev_site_id ) {
// Loop over stores and call switch_site().
global $acf_stores;
foreach ( $acf_stores as $store ) {
$store->switch_site( $site_id, $prev_site_id );
}
}
add_action( 'switch_blog', 'acf_switch_stores', 10, 2 );
/**
* acf_get_path
*
* Returns the plugin path to a specified file.
*
* @date 28/9/13
* @since 5.0.0
*
* @param string $filename The specified file.
* @return string
*/
function acf_get_path( $filename = '' ) {
return ACF_PATH . ltrim( $filename, '/' );
}
/**
* acf_get_url
*
* Returns the plugin url to a specified file.
* This function also defines the ACF_URL constant.
*
* @date 12/12/17
* @since 5.6.8
*
* @param string $filename The specified file.
* @return string
*/
function acf_get_url( $filename = '' ) {
if ( ! defined( 'ACF_URL' ) ) {
define( 'ACF_URL', acf_get_setting( 'url' ) );
}
return ACF_URL . ltrim( $filename, '/' );
}
/*
* acf_include
*
* Includes a file within the ACF plugin.
*
* @date 10/3/14
* @since 5.0.0
*
* @param string $filename The specified file.
* @return void
*/
function acf_include( $filename = '' ) {
$file_path = acf_get_path( $filename );
if ( file_exists( $file_path ) ) {
include_once $file_path;
}
}
<?php
// Register store.
acf_register_store( 'values' )->prop( 'multisite', true );
/**
* acf_get_reference
*
* Retrieves the field key for a given field name and post_id.
*
* @date 26/1/18
* @since 5.6.5
*
* @param string $field_name The name of the field. eg 'sub_heading'.
* @param mixed $post_id The post_id of which the value is saved against.
* @return string The field key.
*/
function acf_get_reference( $field_name, $post_id ) {
// Allow filter to short-circuit load_value logic.
$reference = apply_filters( 'acf/pre_load_reference', null, $field_name, $post_id );
if ( $reference !== null ) {
return $reference;
}
// Get hidden meta for this field name.
$reference = acf_get_metadata( $post_id, $field_name, true );
/**
* Filters the reference value.
*
* @date 25/1/19
* @since 5.7.11
*
* @param string $reference The reference value.
* @param string $field_name The field name.
* @param (int|string) $post_id The post ID where meta is stored.
*/
return apply_filters( 'acf/load_reference', $reference, $field_name, $post_id );
}
/**
* Retrieves the value for a given field and post_id.
*
* @date 28/09/13
* @since 5.0.0
*
* @param int|string $post_id The post id.
* @param array $field The field array.
* @return mixed
*/
function acf_get_value( $post_id, $field ) {
// Allow filter to short-circuit load_value logic.
$value = apply_filters( 'acf/pre_load_value', null, $post_id, $field );
if ( $value !== null ) {
return $value;
}
// Get field name.
$field_name = $field['name'];
// Get field ID & type.
$decoded = acf_decode_post_id( $post_id );
$allow_load = true;
// If we don't have a proper field array, the field doesn't exist currently.
if ( empty( $field['type'] ) && empty( $field['key'] ) ) {
// Check if we should trigger warning about accessing fields too early via action.
do_action( 'acf/get_invalid_field_value', $field, __FUNCTION__ );
if ( apply_filters( 'acf/prevent_access_to_unknown_fields', false ) || ( 'option' === $decoded['type'] && 'options' !== $decoded['id'] ) ) {
$allow_load = false;
}
}
// If we're using a non options_ option key, ensure we have a valid reference key.
if ( 'option' === $decoded['type'] && 'options' !== $decoded['id'] ) {
$meta = acf_get_metadata( $post_id, $field_name, true );
if ( ! $meta ) {
$allow_load = false;
} elseif ( $meta !== $field['key'] ) {
if ( ! isset( $field['__key'] ) || $meta !== $field['__key'] ) {
$allow_load = false;
}
}
}
// Load Store.
$store = acf_get_store( 'values' );
// If we're allowing load, check the store or load value from database.
if ( $allow_load ) {
if ( $store->has( "$post_id:$field_name" ) ) {
return $store->get( "$post_id:$field_name" );
}
$value = acf_get_metadata( $post_id, $field_name );
}
// Use field's default_value if no meta was found.
if ( $value === null && isset( $field['default_value'] ) ) {
$value = $field['default_value'];
}
/**
* Filters the $value after it has been loaded.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The value to preview.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
*/
$value = apply_filters( 'acf/load_value', $value, $post_id, $field );
// Update store if we allowed the value load.
if ( $allow_load ) {
$store->set( "$post_id:$field_name", $value );
}
// Return value.
return $value;
}
// Register variation.
acf_add_filter_variations( 'acf/load_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_format_value
*
* Returns a formatted version of the provided value.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The field value.
* @param (int|string) $post_id The post id.
* @param array $field The field array.
* @return mixed.
*/
function acf_format_value( $value, $post_id, $field ) {
// Allow filter to short-circuit load_value logic.
$check = apply_filters( 'acf/pre_format_value', null, $value, $post_id, $field );
if ( $check !== null ) {
return $check;
}
// Get field name.
$field_name = $field['name'];
// Check store.
$store = acf_get_store( 'values' );
if ( $store->has( "$post_id:$field_name:formatted" ) ) {
return $store->get( "$post_id:$field_name:formatted" );
}
/**
* Filters the $value for use in a template function.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The value to preview.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
*/
$value = apply_filters( 'acf/format_value', $value, $post_id, $field );
// Update store.
$store->set( "$post_id:$field_name:formatted", $value );
// Return value.
return $value;
}
// Register variation.
acf_add_filter_variations( 'acf/format_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_update_value
*
* Updates the value for a given field and post_id.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The new value.
* @param (int|string) $post_id The post id.
* @param array $field The field array.
* @return bool.
*/
function acf_update_value( $value, $post_id, $field ) {
// Allow filter to short-circuit update_value logic.
$check = apply_filters( 'acf/pre_update_value', null, $value, $post_id, $field );
if ( $check !== null ) {
return $check;
}
/**
* Filters the $value before it is updated.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The value to update.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
* @param mixed $original The original value before modification.
*/
$value = apply_filters( 'acf/update_value', $value, $post_id, $field, $value );
// Allow null to delete value.
if ( $value === null ) {
return acf_delete_value( $post_id, $field );
}
// Update meta.
$return = acf_update_metadata( $post_id, $field['name'], $value );
// Update reference.
acf_update_metadata( $post_id, $field['name'], $field['key'], true );
// Delete stored data.
acf_flush_value_cache( $post_id, $field['name'] );
// Return update status.
return $return;
}
// Register variation.
acf_add_filter_variations( 'acf/update_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_update_values
*
* Updates an array of values.
*
* @date 26/2/19
* @since 5.7.13
*
* @param array values The array of values.
* @param (int|string) $post_id The post id.
* @return void
*/
function acf_update_values( $values, $post_id ) {
// Loop over values.
foreach ( $values as $key => $value ) {
// Get field.
$field = acf_get_field( $key );
// Update value.
if ( $field ) {
acf_update_value( $value, $post_id, $field );
}
}
}
/**
* acf_flush_value_cache
*
* Deletes all cached data for this value.
*
* @date 22/1/19
* @since 5.7.10
*
* @param (int|string) $post_id The post id.
* @param string $field_name The field name.
* @return void
*/
function acf_flush_value_cache( $post_id = 0, $field_name = '' ) {
// Delete stored data.
acf_get_store( 'values' )
->remove( "$post_id:$field_name" )
->remove( "$post_id:$field_name:formatted" );
}
/**
* acf_delete_value
*
* Deletes the value for a given field and post_id.
*
* @date 28/09/13
* @since 5.0.0
*
* @param (int|string) $post_id The post id.
* @param array $field The field array.
* @return bool.
*/
function acf_delete_value( $post_id, $field ) {
/**
* Fires before a value is deleted.
*
* @date 28/09/13
* @since 5.0.0
*
* @param string $post_id The post ID for this value.
* @param mixed $name The meta name.
* @param array $field The field array.
*/
do_action( 'acf/delete_value', $post_id, $field['name'], $field );
// Delete meta.
$return = acf_delete_metadata( $post_id, $field['name'] );
// Delete reference.
acf_delete_metadata( $post_id, $field['name'], true );
// Delete stored data.
acf_flush_value_cache( $post_id, $field['name'] );
// Return delete status.
return $return;
}
// Register variation.
acf_add_filter_variations( 'acf/delete_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_preview_value
*
* Return a human friendly 'preview' for a given field value.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The new value.
* @param (int|string) $post_id The post id.
* @param array $field The field array.
* @return bool.
*/
function acf_preview_value( $value, $post_id, $field ) {
/**
* Filters the $value before used in HTML.
*
* @date 24/10/16
* @since 5.5.0
*
* @param mixed $value The value to preview.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
*/
return apply_filters( 'acf/preview_value', $value, $post_id, $field );
}
// Register variation.
acf_add_filter_variations( 'acf/preview_value', array( 'type', 'name', 'key' ), 2 );
/**
* Potentially log an error if a field doesn't exist when we expect it to.
*
* @param array $field An array representing the field that a value was requested for.
* @param string $function The function that noticed the problem.
*
* @return void
*/
function acf_log_invalid_field_notice( $field, $function ) {
// If "init" has fired, ACF probably wasn't initialized early.
if ( did_action( 'init' ) ) {
return;
}
$error_text = sprintf(
__( '<strong>%1$s</strong> - We\'ve detected one or more calls to retrieve ACF field values before ACF has been initialized. This is not supported and can result in malformed or missing data. <a href="%2$s" target="_blank">Learn how to fix this</a>.', 'acf' ),
acf_get_setting( 'name' ),
'https://www.advancedcustomfields.com/resources/acf-field-functions/'
);
_doing_it_wrong( $function, $error_text, '5.11.1' );
}
add_action( 'acf/get_invalid_field_value', 'acf_log_invalid_field_notice', 10, 2 );
<?php
/**
* Returns a WordPress object type.
*
* @date 1/4/20
* @since 5.9.0
*
* @param string $object_type The object type (post, term, user, etc).
* @param string $object_subtype Optional object subtype (post type, taxonomy).
* @return object
*/
function acf_get_object_type( $object_type, $object_subtype = '' ) {
$props = array(
'type' => $object_type,
'subtype' => $object_subtype,
'name' => '',
'label' => '',
'icon' => '',
);
// Set unique identifier as name.
if ( $object_subtype ) {
$props['name'] = "$object_type/$object_subtype";
} else {
$props['name'] = $object_type;
}
// Set label and icon.
switch ( $object_type ) {
case 'post':
if ( $object_subtype ) {
$post_type = get_post_type_object( $object_subtype );
if ( $post_type ) {
$props['label'] = $post_type->labels->name;
$props['icon'] = acf_with_default( $post_type->menu_icon, 'dashicons-admin-post' );
} else {
return false;
}
} else {
$props['label'] = __( 'Posts', 'acf' );
$props['icon'] = 'dashicons-admin-post';
}
break;
case 'term':
if ( $object_subtype ) {
$taxonomy = get_taxonomy( $object_subtype );
if ( $taxonomy ) {
$props['label'] = $taxonomy->labels->name;
} else {
return false;
}
} else {
$props['label'] = __( 'Taxonomies', 'acf' );
}
$props['icon'] = 'dashicons-tag';
break;
case 'attachment':
$props['label'] = __( 'Attachments', 'acf' );
$props['icon'] = 'dashicons-admin-media';
break;
case 'comment':
$props['label'] = __( 'Comments', 'acf' );
$props['icon'] = 'dashicons-admin-comments';
break;
case 'widget':
$props['label'] = __( 'Widgets', 'acf' );
$props['icon'] = 'dashicons-screenoptions';
break;
case 'menu':
$props['label'] = __( 'Menus', 'acf' );
$props['icon'] = 'dashicons-admin-appearance';
break;
case 'menu_item':
$props['label'] = __( 'Menu items', 'acf' );
$props['icon'] = 'dashicons-admin-appearance';
break;
case 'user':
$props['label'] = __( 'Users', 'acf' );
$props['icon'] = 'dashicons-admin-users';
break;
case 'option':
$props['label'] = __( 'Options', 'acf' );
$props['icon'] = 'dashicons-admin-generic';
break;
case 'block':
$props['label'] = __( 'Blocks', 'acf' );
$props['icon'] = acf_version_compare( 'wp', '>=', '5.5' ) ? 'dashicons-block-default' : 'dashicons-layout';
break;
default:
return false;
}
// Convert to object.
$object = (object) $props;
/**
* Filters the object type.
*
* @date 6/4/20
* @since 5.9.0
*
* @param object $object The object props.
* @param string $object_type The object type (post, term, user, etc).
* @param string $object_subtype Optional object subtype (post type, taxonomy).
*/
return apply_filters( 'acf/get_object_type', $object, $object_type, $object_subtype );
}
/**
* Decodes a post_id value such as 1 or "user_1" into an array containing the type and ID.
*
* @date 25/1/19
* @since 5.7.11
*
* @param (int|string) $post_id The post id.
* @return array
*/
function acf_decode_post_id( $post_id = 0 ) {
$type = '';
$id = 0;
// Interpret numeric value (123).
if ( is_numeric( $post_id ) ) {
$type = 'post';
$id = $post_id;
// Interpret string value ("user_123" or "option").
} elseif ( is_string( $post_id ) ) {
$i = strrpos( $post_id, '_' );
if ( $i > 0 ) {
$type = substr( $post_id, 0, $i );
$id = substr( $post_id, $i + 1 );
} else {
$type = $post_id;
$id = '';
}
// Handle incorrect param type.
} else {
return compact( 'type', 'id' );
}
// Validate props based on param format.
$format = $type . '_' . ( is_numeric( $id ) ? '%d' : '%s' );
switch ( $format ) {
case 'post_%d':
$type = 'post';
$id = absint( $id );
break;
case 'term_%d':
$type = 'term';
$id = absint( $id );
break;
case 'attachment_%d':
$type = 'post';
$id = absint( $id );
break;
case 'comment_%d':
$type = 'comment';
$id = absint( $id );
break;
case 'widget_%s':
case 'widget_%d':
$type = 'option';
$id = $post_id;
break;
case 'menu_%d':
$type = 'term';
$id = absint( $id );
break;
case 'menu_item_%d':
$type = 'post';
$id = absint( $id );
break;
case 'user_%d':
$type = 'user';
$id = absint( $id );
break;
case 'block_%s':
case 'block_%d':
$type = 'block';
$id = $post_id;
break;
case 'option_%s':
$type = 'option';
$id = $post_id;
break;
case 'blog_%d':
case 'site_%d':
// Allow backwards compatibility for custom taxonomies.
$type = taxonomy_exists( $type ) ? 'term' : 'blog';
$id = absint( $id );
break;
default:
// Check for taxonomy name.
if ( taxonomy_exists( $type ) && is_numeric( $id ) ) {
$type = 'term';
$id = absint( $id );
break;
}
// Treat unknown post_id format as an option.
$type = 'option';
$id = $post_id;
break;
}
/**
* Filters the decoded post_id information.
*
* @date 25/1/19
* @since 5.7.11
*
* @param array $props An array containing "type" and "id" information.
* @param (int|string) $post_id The post id.
*/
return apply_filters( 'acf/decode_post_id', compact( 'type', 'id' ), $post_id );
}
/**
* Determine the REST base for a post type or taxonomy object. Note that this is not intended for use
* with term or post objects but is, instead, to be used with the underlying WP_Post_Type and WP_Taxonomy
* instances.
*
* @param WP_Post_Type|WP_Taxonomy $type_object
* @return string|null
*/
function acf_get_object_type_rest_base( $type_object ) {
if ( $type_object instanceof WP_Post_Type || $type_object instanceof WP_Taxonomy ) {
return ! empty( $type_object->rest_base ) ? $type_object->rest_base : $type_object->name;
}
return null;
}
/**
* Extract the ID of a given object/array. This supports all expected types handled by our update_fields() and
* load_fields() callbacks.
*
* @param WP_Post|WP_User|WP_Term|WP_Comment|array $object
* @return int|mixed|null
*/
function acf_get_object_id( $object ) {
if ( is_object( $object ) ) {
switch ( get_class( $object ) ) {
case WP_User::class:
case WP_Post::class:
return (int) $object->ID;
case WP_Term::class:
return (int) $object->term_id;
case WP_Comment::class:
return (int) $object->comment_ID;
}
} elseif ( isset( $object['id'] ) ) {
return (int) $object['id'];
} elseif ( isset( $object['ID'] ) ) {
return (int) $object['ID'];
}
return null;
}
<?php
/**
* ACF Admin Notices
*
* Functions and classes to manage admin notices.
*
* @date 10/1/19
* @since 5.7.10
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Register notices store.
acf_register_store( 'notices' );
/**
* ACF_Admin_Notice
*
* Class used to create an admin notice.
*
* @date 10/1/19
* @since 5.7.10
*/
if ( ! class_exists( 'ACF_Admin_Notice' ) ) :
class ACF_Admin_Notice extends ACF_Data {
/** @var array Storage for data. */
var $data = array(
/** @type string Text displayed in notice. */
'text' => '',
/** @type string The type of notice (warning, error, success, info). */
'type' => 'info',
/** @type bool If the notice can be dismissed. */
'dismissible' => true,
);
/**
* render
*
* Renders the notice HTML.
*
* @date 27/12/18
* @since 5.8.0
*
* @param void
* @return void
*/
function render() {
$notice_text = $this->get( 'text' );
$notice_type = $this->get( 'type' );
$is_dismissible = $this->get( 'dismissible' );
printf(
'<div class="acf-admin-notice notice notice-%s %s">%s</div>',
esc_attr( $notice_type ),
$is_dismissible ? 'is-dismissible' : '',
acf_esc_html( wpautop( acf_punctify( $notice_text ) ) )
);
}
}
endif; // class_exists check
/**
* acf_new_admin_notice
*
* Instantiates and returns a new model.
*
* @date 23/12/18
* @since 5.8.0
*
* @param array $data Optional data to set.
* @return ACF_Admin_Notice
*/
function acf_new_admin_notice( $data = false ) {
// Create notice.
$instance = new ACF_Admin_Notice( $data );
// Register notice.
acf_get_store( 'notices' )->set( $instance->cid, $instance );
// Return notice.
return $instance;
}
/**
* acf_render_admin_notices
*
* Renders all admin notices HTML.
*
* @date 10/1/19
* @since 5.7.10
*
* @param void
* @return void
*/
function acf_render_admin_notices() {
// Get notices.
$notices = acf_get_store( 'notices' )->get_data();
// Loop over notices and render.
if ( $notices ) {
foreach ( $notices as $notice ) {
$notice->render();
}
}
}
// Render notices during admin action.
add_action( 'admin_notices', 'acf_render_admin_notices', 99 );
/**
* acf_add_admin_notice
*
* Creates and returns a new notice.
*
* @date 17/10/13
* @since 5.0.0
*
* @param string $text The admin notice text.
* @param string $class The type of notice (warning, error, success, info).
* @param string $dismissable Is this notification dismissible (default true) (since 5.11.0)
* @return ACF_Admin_Notice
*/
function acf_add_admin_notice( $text = '', $type = 'info', $dismissible = true ) {
return acf_new_admin_notice(
array(
'text' => $text,
'type' => $type,
'dismissible' => $dismissible,
)
);
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'acf_admin_tools' ) ) :
class acf_admin_tools {
/** @var array Contains an array of admin tool instances */
var $tools = array();
/** @var string The active tool */
var $active = '';
/**
* __construct
*
* This function will setup the class functionality
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function __construct() {
// actions
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
}
/**
* register_tool
*
* This function will store a tool tool class
*
* @date 10/10/17
* @since 5.6.3
*
* @param string $class
* @return n/a
*/
function register_tool( $class ) {
$instance = new $class();
$this->tools[ $instance->name ] = $instance;
}
/**
* get_tool
*
* This function will return a tool tool class
*
* @date 10/10/17
* @since 5.6.3
*
* @param string $name
* @return n/a
*/
function get_tool( $name ) {
return isset( $this->tools[ $name ] ) ? $this->tools[ $name ] : null;
}
/**
* get_tools
*
* This function will return an array of all tools
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return array
*/
function get_tools() {
return $this->tools;
}
/*
* admin_menu
*
* This function will add the ACF menu item to the WP admin
*
* @type action (admin_menu)
* @date 28/09/13
* @since 5.0.0
*
* @param n/a
* @return n/a
*/
function admin_menu() {
// bail early if no show_admin
if ( ! acf_get_setting( 'show_admin' ) ) {
return;
}
// add page
$page = add_submenu_page( 'edit.php?post_type=acf-field-group', __( 'Tools', 'acf' ), __( 'Tools', 'acf' ), acf_get_setting( 'capability' ), 'acf-tools', array( $this, 'html' ) );
// actions
add_action( 'load-' . $page, array( $this, 'load' ) );
}
/**
* load
*
* description
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function load() {
// disable filters (default to raw data)
acf_disable_filters();
// include tools
$this->include_tools();
// check submit
$this->check_submit();
// load acf scripts
acf_enqueue_scripts();
}
/**
* include_tools
*
* description
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function include_tools() {
// include
acf_include( 'includes/admin/tools/class-acf-admin-tool.php' );
acf_include( 'includes/admin/tools/class-acf-admin-tool-export.php' );
acf_include( 'includes/admin/tools/class-acf-admin-tool-import.php' );
// action
do_action( 'acf/include_admin_tools' );
}
/**
* check_submit
*
* description
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function check_submit() {
// loop
foreach ( $this->get_tools() as $tool ) {
// load
$tool->load();
// submit
if ( acf_verify_nonce( $tool->name ) ) {
$tool->submit();
}
}
}
/**
* html
*
* description
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function html() {
// vars
$screen = get_current_screen();
$active = acf_maybe_get_GET( 'tool' );
// view
$view = array(
'screen_id' => $screen->id,
'active' => $active,
);
// register metaboxes
foreach ( $this->get_tools() as $tool ) {
// check active
if ( $active && $active !== $tool->name ) {
continue;
}
// add metabox
add_meta_box( 'acf-admin-tool-' . $tool->name, acf_esc_html( $tool->title ), array( $this, 'metabox_html' ), $screen->id, 'normal', 'default', array( 'tool' => $tool->name ) );
}
// view
acf_get_view( 'html-admin-tools', $view );
}
/**
* meta_box_html
*
* description
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function metabox_html( $post, $metabox ) {
// vars
$tool = $this->get_tool( $metabox['args']['tool'] );
?>
<form method="post">
<?php $tool->html(); ?>
<?php acf_nonce_input( $tool->name ); ?>
</form>
<?php
}
}
// initialize
acf()->admin_tools = new acf_admin_tools();
endif; // class_exists check
/*
* acf_register_admin_tool
*
* alias of acf()->admin_tools->register_tool()
*
* @type function
* @date 31/5/17
* @since 5.6.0
*
* @param n/a
* @return n/a
*/
function acf_register_admin_tool( $class ) {
return acf()->admin_tools->register_tool( $class );
}
/*
* acf_get_admin_tools_url
*
* This function will return the admin URL to the tools page
*
* @type function
* @date 31/5/17
* @since 5.6.0
*
* @param n/a
* @return n/a
*/
function acf_get_admin_tools_url() {
return admin_url( 'edit.php?post_type=acf-field-group&page=acf-tools' );
}
/*
* acf_get_admin_tool_url
*
* This function will return the admin URL to the tools page
*
* @type function
* @date 31/5/17
* @since 5.6.0
*
* @param n/a
* @return n/a
*/
function acf_get_admin_tool_url( $tool = '' ) {
return acf_get_admin_tools_url() . '&tool=' . $tool;
}
?>
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'ACF_Admin_Upgrade' ) ) :
class ACF_Admin_Upgrade {
/**
* __construct
*
* Sets up the class functionality.
*
* @date 31/7/18
* @since 5.7.2
*
* @param void
* @return void
*/
function __construct() {
// actions
add_action( 'admin_menu', array( $this, 'admin_menu' ), 20 );
if ( is_multisite() ) {
add_action( 'network_admin_menu', array( $this, 'network_admin_menu' ), 20 );
}
}
/**
* admin_menu
*
* Setus up logic if DB Upgrade is needed on a single site.
*
* @date 24/8/18
* @since 5.7.4
*
* @param void
* @return void
*/
function admin_menu() {
// check if upgrade is avaialble
if ( acf_has_upgrade() ) {
// add notice
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
// add page
$page = add_submenu_page( 'index.php', __( 'Upgrade Database', 'acf' ), __( 'Upgrade Database', 'acf' ), acf_get_setting( 'capability' ), 'acf-upgrade', array( $this, 'admin_html' ) );
// actions
add_action( 'load-' . $page, array( $this, 'admin_load' ) );
}
}
/**
* network_admin_menu
*
* Sets up admin logic if DB Upgrade is required on a multi site.
*
* @date 24/8/18
* @since 5.7.4
*
* @param void
* @return void
*/
function network_admin_menu() {
// Vars.
$upgrade = false;
// Loop over sites and check for upgrades.
$sites = get_sites( array( 'number' => 0 ) );
if ( $sites ) {
// Unhook action to avoid memory issue (as seen in wp-includes/ms-site.php).
remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );
foreach ( $sites as $site ) {
// Switch site.
switch_to_blog( $site->blog_id );
// Check for upgrade.
$site_upgrade = acf_has_upgrade();
// Restore site.
// Ideally, we would switch back to the original site at after looping, however,
// the restore_current_blog() is needed to modify global vars.
restore_current_blog();
// Check if upgrade was found.
if ( $site_upgrade ) {
$upgrade = true;
break;
}
}
add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );
}
// Bail early if no upgrade is needed.
if ( ! $upgrade ) {
return;
}
// Add notice.
add_action( 'network_admin_notices', array( $this, 'network_admin_notices' ) );
// Add page.
$page = add_submenu_page(
'index.php',
__( 'Upgrade Database', 'acf' ),
__( 'Upgrade Database', 'acf' ),
acf_get_setting( 'capability' ),
'acf-upgrade-network',
array( $this, 'network_admin_html' )
);
add_action( "load-$page", array( $this, 'network_admin_load' ) );
}
/**
* admin_load
*
* Runs during the loading of the admin page.
*
* @date 24/8/18
* @since 5.7.4
*
* @param type $var Description. Default.
* @return type Description.
*/
function admin_load() {
// remove prompt
remove_action( 'admin_notices', array( $this, 'admin_notices' ) );
// Enqueue core script.
acf_enqueue_script( 'acf' );
}
/**
* network_admin_load
*
* Runs during the loading of the network admin page.
*
* @date 24/8/18
* @since 5.7.4
*
* @param type $var Description. Default.
* @return type Description.
*/
function network_admin_load() {
// remove prompt
remove_action( 'network_admin_notices', array( $this, 'network_admin_notices' ) );
// Enqueue core script.
acf_enqueue_script( 'acf' );
}
/**
* admin_notices
*
* Displays the DB Upgrade prompt.
*
* @date 23/8/18
* @since 5.7.3
*
* @param void
* @return void
*/
function admin_notices() {
// vars
$view = array(
'button_text' => __( 'Upgrade Database', 'acf' ),
'button_url' => admin_url( 'index.php?page=acf-upgrade' ),
'confirm' => true,
);
// view
acf_get_view( 'html-notice-upgrade', $view );
}
/**
* network_admin_notices
*
* Displays the DB Upgrade prompt on a multi site.
*
* @date 23/8/18
* @since 5.7.3
*
* @param void
* @return void
*/
function network_admin_notices() {
// vars
$view = array(
'button_text' => __( 'Review sites & upgrade', 'acf' ),
'button_url' => network_admin_url( 'index.php?page=acf-upgrade-network' ),
'confirm' => false,
);
// view
acf_get_view( 'html-notice-upgrade', $view );
}
/**
* admin_html
*
* Displays the HTML for the admin page.
*
* @date 24/8/18
* @since 5.7.4
*
* @param void
* @return void
*/
function admin_html() {
acf_get_view( 'html-admin-page-upgrade' );
}
/**
* network_admin_html
*
* Displays the HTML for the network upgrade admin page.
*
* @date 24/8/18
* @since 5.7.4
*
* @param void
* @return void
*/
function network_admin_html() {
acf_get_view( 'html-admin-page-upgrade-network' );
}
}
// instantiate
acf_new_instance( 'ACF_Admin_Upgrade' );
endif; // class_exists check
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'ACF_Admin' ) ) :
class ACF_Admin {
/**
* Constructor.
*
* @date 23/06/12
* @since 5.0.0
*
* @param void
* @return void
*/
function __construct() {
// Add actions.
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
add_action( 'admin_body_class', array( $this, 'admin_body_class' ) );
add_action( 'current_screen', array( $this, 'current_screen' ) );
}
/**
* Adds the ACF menu item.
*
* @date 28/09/13
* @since 5.0.0
*
* @param void
* @return void
*/
function admin_menu() {
// Bail early if ACF is hidden.
if ( ! acf_get_setting( 'show_admin' ) ) {
return;
}
// Vars.
$slug = 'edit.php?post_type=acf-field-group';
$cap = acf_get_setting( 'capability' );
// Add menu items.
add_menu_page( __( 'Custom Fields', 'acf' ), __( 'Custom Fields', 'acf' ), $cap, $slug, false, 'dashicons-welcome-widgets-menus', 80 );
add_submenu_page( $slug, __( 'Field Groups', 'acf' ), __( 'Field Groups', 'acf' ), $cap, $slug );
add_submenu_page( $slug, __( 'Add New', 'acf' ), __( 'Add New', 'acf' ), $cap, 'post-new.php?post_type=acf-field-group' );
}
/**
* Enqueues global admin styling.
*
* @date 28/09/13
* @since 5.0.0
*
* @param void
* @return void
*/
function admin_enqueue_scripts() {
wp_enqueue_style( 'acf-global' );
}
/**
* Appends custom admin body classes.
*
* @date 5/11/19
* @since 5.8.7
*
* @param string $classes Space-separated list of CSS classes.
* @return string
*/
function admin_body_class( $classes ) {
global $wp_version;
// Determine body class version.
$wp_minor_version = floatval( $wp_version );
if ( $wp_minor_version >= 5.3 ) {
$classes .= ' acf-admin-5-3';
} else {
$classes .= ' acf-admin-3-8';
}
// Add browser for specific CSS.
$classes .= ' acf-browser-' . acf_get_browser();
// Return classes.
return $classes;
}
/**
* Adds custom functionality to "ACF" admin pages.
*
* @date 7/4/20
* @since 5.9.0
*
* @param void
* @return void
*/
function current_screen( $screen ) {
// Determine if the current page being viewed is "ACF" related.
if ( isset( $screen->post_type ) && $screen->post_type === 'acf-field-group' ) {
add_action( 'in_admin_header', array( $this, 'in_admin_header' ) );
add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
$this->setup_help_tab();
}
}
/**
* Sets up the admin help tab.
*
* @date 20/4/20
* @since 5.9.0
*
* @param void
* @return void
*/
public function setup_help_tab() {
$screen = get_current_screen();
// Overview tab.
$screen->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview', 'acf' ),
'content' =>
'<p><strong>' . __( 'Overview', 'acf' ) . '</strong></p>' .
'<p>' . __( 'The Advanced Custom Fields plugin provides a visual form builder to customize WordPress edit screens with extra fields, and an intuitive API to display custom field values in any theme template file.', 'acf' ) . '</p>' .
'<p>' . sprintf(
__( 'Before creating your first Field Group, we recommend first reading our <a href="%s" target="_blank">Getting started</a> guide to familiarize yourself with the plugin\'s philosophy and best practises.', 'acf' ),
'https://www.advancedcustomfields.com/resources/getting-started-with-acf/'
) . '</p>' .
'<p>' . __( 'Please use the Help & Support tab to get in touch should you find yourself requiring assistance.', 'acf' ) . '</p>' .
'',
)
);
// Help tab.
$screen->add_help_tab(
array(
'id' => 'help',
'title' => __( 'Help & Support', 'acf' ),
'content' =>
'<p><strong>' . __( 'Help & Support', 'acf' ) . '</strong></p>' .
'<p>' . __( 'We are fanatical about support, and want you to get the best out of your website with ACF. If you run into any difficulties, there are several places you can find help:', 'acf' ) . '</p>' .
'<ul>' .
'<li>' . sprintf(
__( '<a href="%s" target="_blank">Documentation</a>. Our extensive documentation contains references and guides for most situations you may encounter.', 'acf' ),
'https://www.advancedcustomfields.com/resources/'
) . '</li>' .
'<li>' . sprintf(
__( '<a href="%s" target="_blank">Discussions</a>. We have an active and friendly community on our Community Forums who may be able to help you figure out the ‘how-tos’ of the ACF world.', 'acf' ),
'https://support.advancedcustomfields.com/'
) . '</li>' .
'<li>' . sprintf(
__( '<a href="%s" target="_blank">Help Desk</a>. The support professionals on our Help Desk will assist with your more in depth, technical challenges.', 'acf' ),
'https://www.advancedcustomfields.com/support/'
) . '</li>' .
'</ul>',
)
);
// Sidebar.
$screen->set_help_sidebar(
'<p><strong>' . __( 'Information', 'acf' ) . '</strong></p>' .
'<p><span class="dashicons dashicons-admin-plugins"></span> ' . sprintf( __( 'Version %s', 'acf' ), ACF_VERSION ) . '</p>' .
'<p><span class="dashicons dashicons-wordpress"></span> <a href="https://wordpress.org/plugins/advanced-custom-fields/" target="_blank">' . __( 'View details', 'acf' ) . '</a></p>' .
'<p><span class="dashicons dashicons-admin-home"></span> <a href="https://www.advancedcustomfields.com/" target="_blank" target="_blank">' . __( 'Visit website', 'acf' ) . '</a></p>' .
''
);
}
/**
* Renders the admin navigation element.
*
* @date 27/3/20
* @since 5.9.0
*
* @param void
* @return void
*/
function in_admin_header() {
acf_get_view( 'html-admin-navigation' );
}
/**
* Modifies the admin footer text.
*
* @date 7/4/20
* @since 5.9.0
*
* @param string $text The admin footer text.
* @return string
*/
function admin_footer_text( $text ) {
// Use RegExp to append "ACF" after the <a> element allowing translations to read correctly.
return preg_replace( '/(<a[\S\s]+?\/a>)/', '$1 ' . __( 'and', 'acf' ) . ' <a href="https://www.advancedcustomfields.com" target="_blank">ACF</a>', $text, 1 );
}
}
// Instantiate.
acf_new_instance( 'ACF_Admin' );
endif; // class_exists check
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'ACF_Admin_Tool_Import' ) ) :
class ACF_Admin_Tool_Import extends ACF_Admin_Tool {
/**
* initialize
*
* This function will initialize the admin tool
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function initialize() {
// vars
$this->name = 'import';
$this->title = __( 'Import Field Groups', 'acf' );
$this->icon = 'dashicons-upload';
}
/**
* html
*
* This function will output the metabox HTML
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function html() {
?>
<p><?php _e( 'Select the Advanced Custom Fields JSON file you would like to import. When you click the import button below, ACF will import the field groups.', 'acf' ); ?></p>
<div class="acf-fields">
<?php
acf_render_field_wrap(
array(
'label' => __( 'Select File', 'acf' ),
'type' => 'file',
'name' => 'acf_import_file',
'value' => false,
'uploader' => 'basic',
)
);
?>
</div>
<p class="acf-submit">
<input type="submit" class="button button-primary" value="<?php _e( 'Import File', 'acf' ); ?>" />
</p>
<?php
}
/**
* submit
*
* This function will run when the tool's form has been submit
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function submit() {
// Check file size.
if ( empty( $_FILES['acf_import_file']['size'] ) ) {
return acf_add_admin_notice( __( 'No file selected', 'acf' ), 'warning' );
}
// Get file data.
$file = $_FILES['acf_import_file'];
// Check errors.
if ( $file['error'] ) {
return acf_add_admin_notice( __( 'Error uploading file. Please try again', 'acf' ), 'warning' );
}
// Check file type.
if ( pathinfo( $file['name'], PATHINFO_EXTENSION ) !== 'json' ) {
return acf_add_admin_notice( __( 'Incorrect file type', 'acf' ), 'warning' );
}
// Read JSON.
$json = file_get_contents( $file['tmp_name'] );
$json = json_decode( $json, true );
// Check if empty.
if ( ! $json || ! is_array( $json ) ) {
return acf_add_admin_notice( __( 'Import file empty', 'acf' ), 'warning' );
}
// Ensure $json is an array of groups.
if ( isset( $json['key'] ) ) {
$json = array( $json );
}
// Remeber imported field group ids.
$ids = array();
// Loop over json
foreach ( $json as $field_group ) {
// Search database for existing field group.
$post = acf_get_field_group_post( $field_group['key'] );
if ( $post ) {
$field_group['ID'] = $post->ID;
}
// Import field group.
$field_group = acf_import_field_group( $field_group );
// append message
$ids[] = $field_group['ID'];
}
// Count number of imported field groups.
$total = count( $ids );
// Generate text.
$text = sprintf( _n( 'Imported 1 field group', 'Imported %s field groups', $total, 'acf' ), $total );
// Add links to text.
$links = array();
foreach ( $ids as $id ) {
$links[] = '<a href="' . get_edit_post_link( $id ) . '">' . get_the_title( $id ) . '</a>';
}
$text .= ' ' . implode( ', ', $links );
// Add notice
acf_add_admin_notice( $text, 'success' );
}
}
// initialize
acf_register_admin_tool( 'ACF_Admin_Tool_Import' );
endif; // class_exists check
?>
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! class_exists( 'ACF_Admin_Tool' ) ) :
class ACF_Admin_Tool {
/** @var string Tool name */
var $name = '';
/** @var string Tool title */
var $title = '';
/** @var string Dashicon slug */
// var $icon = '';
/** @var boolean Redirect form to single */
// var $redirect = false;
/**
* get_name
*
* This function will return the Tool's name
*
* @date 19/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function get_name() {
return $this->name;
}
/**
* get_title
*
* This function will return the Tool's title
*
* @date 19/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function get_title() {
return $this->title;
}
/**
* get_url
*
* This function will return the Tool's title
*
* @date 19/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function get_url() {
return acf_get_admin_tool_url( $this->name );
}
/**
* is_active
*
* This function will return true if the tool is active
*
* @date 19/10/17
* @since 5.6.3
*
* @param n/a
* @return bool
*/
function is_active() {
return acf_maybe_get_GET( 'tool' ) === $this->name;
}
/*
* __construct
*
* This function will setup the class functionality
*
* @type function
* @date 27/6/17
* @since 5.6.0
*
* @param n/a
* @return n/a
*/
function __construct() {
// initialize
$this->initialize();
}
/**
* initialize
*
* This function will initialize the admin tool
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function initialize() {
/* do nothing */
}
/**
* load
*
* This function is called during the admin page load
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function load() {
/* do nothing */
}
/**
* html
*
* This function will output the metabox HTML
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function html() {
}
/**
* submit
*
* This function will run when the tool's form has been submit
*
* @date 10/10/17
* @since 5.6.3
*
* @param n/a
* @return n/a
*/
function submit() {
}
}
endif; // class_exists check
<?php
// vars
$disabled = false;
// empty
if ( empty( $field['conditional_logic'] ) ) {
$disabled = true;
$field['conditional_logic'] = array(
// group 0
array(
// rule 0
array(),
),
);
}
?>
<tr class="acf-field acf-field-true-false acf-field-setting-conditional_logic" data-type="true_false" data-name="conditional_logic">
<td class="acf-label">
<label><?php _e( 'Conditional Logic', 'acf' ); ?></label>
</td>
<td class="acf-input">
<?php
acf_render_field(
array(
'type' => 'true_false',
'name' => 'conditional_logic',
'prefix' => $field['prefix'],
'value' => $disabled ? 0 : 1,
'ui' => 1,
'class' => 'conditions-toggle',
)
);
?>
<div class="rule-groups"
<?php
if ( $disabled ) :
?>
style="display:none;"<?php endif; ?>>
<?php
foreach ( $field['conditional_logic'] as $group_id => $group ) :
// validate
if ( empty( $group ) ) {
continue;
}
// vars
// $group_id must be completely different to $rule_id to avoid JS issues
$group_id = "group_{$group_id}";
$h4 = ( $group_id == 'group_0' ) ? __( 'Show this field if', 'acf' ) : __( 'or', 'acf' );
?>
<div class="rule-group" data-id="<?php echo $group_id; ?>">
<h4><?php echo $h4; ?></h4>
<table class="acf-table -clear">
<tbody>
<?php
foreach ( $group as $rule_id => $rule ) :
// valid rule
$rule = wp_parse_args(
$rule,
array(
'field' => '',
'operator' => '',
'value' => '',
)
);
// vars
// $group_id must be completely different to $rule_id to avoid JS issues
$rule_id = "rule_{$rule_id}";
$prefix = "{$field['prefix']}[conditional_logic][{$group_id}][{$rule_id}]";
// data attributes
$attributes = array(
'data-id' => $rule_id,
'data-field' => $rule['field'],
'data-operator' => $rule['operator'],
'data-value' => $rule['value'],
);
?>
<tr class="rule" <?php acf_esc_attr_e( $attributes ); ?>>
<td class="param">
<?php
acf_render_field(
array(
'type' => 'select',
'prefix' => $prefix,
'name' => 'field',
'class' => 'condition-rule-field',
'disabled' => $disabled,
'value' => $rule['field'],
'choices' => array(
$rule['field'] => $rule['field'],
),
)
);
?>
</td>
<td class="operator">
<?php
acf_render_field(
array(
'type' => 'select',
'prefix' => $prefix,
'name' => 'operator',
'class' => 'condition-rule-operator',
'disabled' => $disabled,
'value' => $rule['operator'],
'choices' => array(
$rule['operator'] => $rule['operator'],
),
)
);
?>
</td>
<td class="value">
<?php
// create field
acf_render_field(
array(
'type' => 'select',
'prefix' => $prefix,
'name' => 'value',
'class' => 'condition-rule-value',
'disabled' => $disabled,
'value' => $rule['value'],
'choices' => array(
$rule['value'] => $rule['value'],
),
)
);
?>
</td>
<td class="add">
<a href="#" class="button add-conditional-rule"><?php _e( 'and', 'acf' ); ?></a>
</td>
<td class="remove">
<a href="#" class="acf-icon -minus remove-conditional-rule"></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endforeach; ?>
<h4><?php _e( 'or', 'acf' ); ?></h4>
<a href="#" class="button add-conditional-group"><?php _e( 'Add rule group', 'acf' ); ?></a>
</div>
</td>
</tr>
<?php
// Define input name prefix using unique identifier.
$input_prefix = 'acf_fields[' . $field['ID'] . ']';
$input_id = acf_idify( $input_prefix );
// Update field props.
$field['prefix'] = $input_prefix;
// Elements.
$div_attrs = array(
'class' => 'acf-field-object acf-field-object-' . acf_slugify( $field['type'] ),
'data-id' => $field['ID'],
'data-key' => $field['key'],
'data-type' => $field['type'],
);
// Misc template vars.
$field_label = acf_get_field_label( $field, 'admin' );
$field_type_label = acf_get_field_type_label( $field['type'] );
?>
<div <?php echo acf_esc_attr( $div_attrs ); ?>>
<div class="meta">
<?php
$meta_inputs = array(
'ID' => $field['ID'],
'key' => $field['key'],
'parent' => $field['parent'],
'menu_order' => $i,
'save' => '',
);
foreach ( $meta_inputs as $k => $v ) :
acf_hidden_input(
array(
'name' => $input_prefix . '[' . $k . ']',
'value' => $v,
'id' => $input_id . '-' . $k,
)
);
endforeach;
?>
</div>
<div class="handle">
<ul class="acf-hl acf-tbody">
<li class="li-field-order">
<span class="acf-icon acf-sortable-handle" title="<?php _e( 'Drag to reorder', 'acf' ); ?>"><?php echo ( $i + 1 ); ?></span>
</li>
<li class="li-field-label">
<strong>
<a class="edit-field" title="<?php _e( 'Edit field', 'acf' ); ?>" href="#"><?php echo acf_esc_html( $field_label ); ?></a>
</strong>
<div class="row-options">
<a class="edit-field" title="<?php _e( 'Edit field', 'acf' ); ?>" href="#"><?php _e( 'Edit', 'acf' ); ?></a>
<a class="duplicate-field" title="<?php _e( 'Duplicate field', 'acf' ); ?>" href="#"><?php _e( 'Duplicate', 'acf' ); ?></a>
<a class="move-field" title="<?php _e( 'Move field to another group', 'acf' ); ?>" href="#"><?php _e( 'Move', 'acf' ); ?></a>
<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-type"> <?php echo esc_html( $field_type_label ); ?></li>
</ul>
</div>
<div class="settings">
<table class="acf-table">
<tbody class="acf-field-settings">
<?php
// label
acf_render_field_setting(
$field,
array(
'label' => __( 'Field Label', 'acf' ),
'instructions' => __( 'This is the name which will appear on the EDIT page', 'acf' ),
'name' => 'label',
'type' => 'text',
'class' => 'field-label',
),
true
);
// name
acf_render_field_setting(
$field,
array(
'label' => __( 'Field Name', 'acf' ),
'instructions' => __( 'Single word, no spaces. Underscores and dashes allowed', 'acf' ),
'name' => 'name',
'type' => 'text',
'class' => 'field-name',
),
true
);
// type
acf_render_field_setting(
$field,
array(
'label' => __( 'Field Type', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'type',
'choices' => acf_get_grouped_field_types(),
'class' => 'field-type',
),
true
);
// instructions
acf_render_field_setting(
$field,
array(
'label' => __( 'Instructions', 'acf' ),
'instructions' => __( 'Instructions for authors. Shown when submitting data', 'acf' ),
'type' => 'textarea',
'name' => 'instructions',
'rows' => 5,
),
true
);
// required
acf_render_field_setting(
$field,
array(
'label' => __( 'Required?', 'acf' ),
'instructions' => '',
'type' => 'true_false',
'name' => 'required',
'ui' => 1,
'class' => 'field-required',
),
true
);
// 3rd party settings
do_action( 'acf/render_field_settings', $field );
// type specific settings
do_action( "acf/render_field_settings/type={$field['type']}", $field );
// conditional logic
acf_get_view( 'field-group-field-conditional-logic', array( 'field' => $field ) );
// wrapper
acf_render_field_wrap(
array(
'label' => __( 'Wrapper Attributes', 'acf' ),
'instructions' => '',
'type' => 'number',
'name' => 'width',
'prefix' => $field['prefix'] . '[wrapper]',
'value' => $field['wrapper']['width'],
'prepend' => __( 'width', 'acf' ),
'append' => '%',
'wrapper' => array(
'data-name' => 'wrapper',
'class' => 'acf-field-setting-wrapper',
),
),
'tr'
);
acf_render_field_wrap(
array(
'label' => '',
'instructions' => '',
'type' => 'text',
'name' => 'class',
'prefix' => $field['prefix'] . '[wrapper]',
'value' => $field['wrapper']['class'],
'prepend' => __( 'class', 'acf' ),
'wrapper' => array(
'data-append' => 'wrapper',
),
),
'tr'
);
acf_render_field_wrap(
array(
'label' => '',
'instructions' => '',
'type' => 'text',
'name' => 'id',
'prefix' => $field['prefix'] . '[wrapper]',
'value' => $field['wrapper']['id'],
'prepend' => __( 'id', 'acf' ),
'wrapper' => array(
'data-append' => 'wrapper',
),
),
'tr'
);
?>
<tr class="acf-field acf-field-save">
<td class="acf-label"></td>
<td class="acf-input">
<ul class="acf-hl">
<li>
<a class="button edit-field" title="<?php _e( 'Close Field', 'acf' ); ?>" href="#"><?php _e( 'Close Field', 'acf' ); ?></a>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="acf-field-list-wrap">
<ul class="acf-hl acf-thead">
<li class="li-field-order"><?php _e( 'Order', 'acf' ); ?></li>
<li class="li-field-label"><?php _e( 'Label', 'acf' ); ?></li>
<li class="li-field-name"><?php _e( 'Name', 'acf' ); ?></li>
<li class="li-field-key"><?php _e( 'Key', 'acf' ); ?></li>
<li class="li-field-type"><?php _e( 'Type', 'acf' ); ?></li>
</ul>
<div class="acf-field-list
<?php
if ( ! $fields ) {
echo ' -empty'; }
?>
">
<div class="no-fields-message">
<?php _e( 'No fields. Click the <strong>+ Add Field</strong> button to create your first field.', 'acf' ); ?>
</div>
<?php
if ( $fields ) :
foreach ( $fields as $i => $field ) :
acf_get_view(
'field-group-field',
array(
'field' => $field,
'i' => $i,
)
);
endforeach;
endif;
?>
</div>
<ul class="acf-hl acf-tfoot">
<li class="acf-fr">
<a href="#" class="button button-primary button-large add-field"><?php _e( '+ Add Field', 'acf' ); ?></a>
</li>
</ul>
<?php
if ( ! $parent ) :
// get clone
$clone = acf_get_valid_field(
array(
'ID' => 'acfcloneindex',
'key' => 'acfcloneindex',
'label' => __( 'New Field', 'acf' ),
'name' => 'new_field',
'type' => 'text',
)
);
?>
<script type="text/html" id="tmpl-acf-field">
<?php
acf_get_view(
'field-group-field',
array(
'field' => $clone,
'i' => 0,
)
);
?>
</script>
<?php endif; ?>
</div>
<?php
// global
global $field_group;
?>
<div class="acf-field">
<div class="acf-label">
<label><?php _e( 'Rules', 'acf' ); ?></label>
<p class="description"><?php _e( 'Create a set of rules to determine which edit screens will use these advanced custom fields', 'acf' ); ?></p>
</div>
<div class="acf-input">
<div class="rule-groups">
<?php
foreach ( $field_group['location'] as $i => $group ) :
// bail ealry if no group
if ( empty( $group ) ) {
return;
}
// view
acf_get_view(
'html-location-group',
array(
'group' => $group,
'group_id' => "group_{$i}",
)
);
endforeach;
?>
<h4><?php _e( 'or', 'acf' ); ?></h4>
<a href="#" class="button add-location-group"><?php _e( 'Add rule group', 'acf' ); ?></a>
</div>
</div>
</div>
<script type="text/javascript">
if( typeof acf !== 'undefined' ) {
acf.newPostbox({
'id': 'acf-field-group-locations',
'label': 'left'
});
}
</script>
<?php
// global
global $field_group;
// active
acf_render_field_wrap(
array(
'label' => __( 'Active', 'acf' ),
'instructions' => '',
'type' => 'true_false',
'name' => 'active',
'prefix' => 'acf_field_group',
'value' => $field_group['active'],
'ui' => 1,
// 'ui_on_text' => __('Active', 'acf'),
// 'ui_off_text' => __('Inactive', 'acf'),
)
);
// Show fields in REST API.
if ( acf_get_setting( 'rest_api_enabled' ) ) {
acf_render_field_wrap(
array(
'label' => __( 'Show in REST API', 'acf' ),
'instructions' => '',
'type' => 'true_false',
'name' => 'show_in_rest',
'prefix' => 'acf_field_group',
'value' => $field_group['show_in_rest'],
'ui' => 1,
// 'ui_on_text' => __('Active', 'acf'),
// 'ui_off_text' => __('Inactive', 'acf'),
)
);
}
// style
acf_render_field_wrap(
array(
'label' => __( 'Style', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'style',
'prefix' => 'acf_field_group',
'value' => $field_group['style'],
'choices' => array(
'default' => __( 'Standard (WP metabox)', 'acf' ),
'seamless' => __( 'Seamless (no metabox)', 'acf' ),
),
)
);
// position
acf_render_field_wrap(
array(
'label' => __( 'Position', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'position',
'prefix' => 'acf_field_group',
'value' => $field_group['position'],
'choices' => array(
'acf_after_title' => __( 'High (after title)', 'acf' ),
'normal' => __( 'Normal (after content)', 'acf' ),
'side' => __( 'Side', 'acf' ),
),
'default_value' => 'normal',
)
);
// label_placement
acf_render_field_wrap(
array(
'label' => __( 'Label placement', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'label_placement',
'prefix' => 'acf_field_group',
'value' => $field_group['label_placement'],
'choices' => array(
'top' => __( 'Top aligned', 'acf' ),
'left' => __( 'Left aligned', 'acf' ),
),
)
);
// instruction_placement
acf_render_field_wrap(
array(
'label' => __( 'Instruction placement', 'acf' ),
'instructions' => '',
'type' => 'select',
'name' => 'instruction_placement',
'prefix' => 'acf_field_group',
'value' => $field_group['instruction_placement'],
'choices' => array(
'label' => __( 'Below labels', 'acf' ),
'field' => __( 'Below fields', 'acf' ),
),
)
);
// menu_order
acf_render_field_wrap(
array(
'label' => __( 'Order No.', 'acf' ),
'instructions' => __( 'Field groups with a lower order will appear first', 'acf' ),
'type' => 'number',
'name' => 'menu_order',
'prefix' => 'acf_field_group',
'value' => $field_group['menu_order'],
)
);
// description
acf_render_field_wrap(
array(
'label' => __( 'Description', 'acf' ),
'instructions' => __( 'Shown in field group list', 'acf' ),
'type' => 'text',
'name' => 'description',
'prefix' => 'acf_field_group',
'value' => $field_group['description'],
)
);
// hide on screen
$choices = array(
'permalink' => __( 'Permalink', 'acf' ),
'the_content' => __( 'Content Editor', 'acf' ),
'excerpt' => __( 'Excerpt', 'acf' ),
'custom_fields' => __( 'Custom Fields', 'acf' ),
'discussion' => __( 'Discussion', 'acf' ),
'comments' => __( 'Comments', 'acf' ),
'revisions' => __( 'Revisions', 'acf' ),
'slug' => __( 'Slug', 'acf' ),
'author' => __( 'Author', 'acf' ),
'format' => __( 'Format', 'acf' ),
'page_attributes' => __( 'Page Attributes', 'acf' ),
'featured_image' => __( 'Featured Image', 'acf' ),
'categories' => __( 'Categories', 'acf' ),
'tags' => __( 'Tags', 'acf' ),
'send-trackbacks' => __( 'Send Trackbacks', 'acf' ),
);
if ( acf_get_setting( 'remove_wp_meta_box' ) ) {
unset( $choices['custom_fields'] );
}
acf_render_field_wrap(
array(
'label' => __( 'Hide on screen', 'acf' ),
'instructions' => __( '<b>Select</b> items to <b>hide</b> them from the edit screen.', 'acf' ) . '<br /><br />' . __( "If multiple field groups appear on an edit screen, the first field group's options will be used (the one with the lowest order number)", 'acf' ),
'type' => 'checkbox',
'name' => 'hide_on_screen',
'prefix' => 'acf_field_group',
'value' => $field_group['hide_on_screen'],
'toggle' => true,
'choices' => $choices,
)
);
// 3rd party settings
do_action( 'acf/render_field_group_settings', $field_group );
?>
<div class="acf-hidden">
<input type="hidden" name="acf_field_group[key]" value="<?php echo $field_group['key']; ?>" />
</div>
<script type="text/javascript">
if( typeof acf !== 'undefined' ) {
acf.newPostbox({
'id': 'acf-field-group-options',
'label': 'left'
});
}
</script>
<?php
/**
* The template for displaying admin navigation.
*
* @date 27/3/20
* @since 5.9.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $submenu, $parent_file, $submenu_file, $plugin_page, $pagenow;
// Vars.
$parent_slug = 'edit.php?post_type=acf-field-group';
// Generate array of navigation items.
$tabs = array();
if ( isset( $submenu[ $parent_slug ] ) ) {
foreach ( $submenu[ $parent_slug ] as $i => $sub_item ) {
// Check user can access page.
if ( ! current_user_can( $sub_item[1] ) ) {
continue;
}
// Ignore "Add New".
if ( $i === 1 ) {
continue;
}
// Define tab.
$tab = array(
'text' => $sub_item[0],
'url' => $sub_item[2],
);
// Convert submenu slug "test" to "$parent_slug&page=test".
if ( ! strpos( $sub_item[2], '.php' ) ) {
$tab['url'] = add_query_arg( array( 'page' => $sub_item[2] ), $parent_slug );
}
// Detect active state.
if ( $submenu_file === $sub_item[2] || $plugin_page === $sub_item[2] ) {
$tab['is_active'] = true;
}
// Special case for "Add New" page.
if ( $i === 0 && $submenu_file === 'post-new.php?post_type=acf-field-group' ) {
$tab['is_active'] = true;
}
$tabs[] = $tab;
}
}
/**
* Filters the admin navigation tabs.
*
* @date 27/3/20
* @since 5.9.0
*
* @param array $tabs The array of navigation tabs.
*/
$tabs = apply_filters( 'acf/admin/toolbar', $tabs );
// Bail early if set to false.
if ( $tabs === false ) {
return;
}
?>
<div class="acf-admin-toolbar">
<h2><i class="acf-tab-icon dashicons dashicons-welcome-widgets-menus"></i> <?php echo acf_get_setting( 'name' ); ?></h2>
<?php
foreach ( $tabs as $tab ) {
printf(
'<a class="acf-tab%s" href="%s">%s</a>',
! empty( $tab['is_active'] ) ? ' is-active' : '',
esc_url( $tab['url'] ),
acf_esc_html( $tab['text'] )
);
}
?>
<?php if ( ! defined( 'ACF_PRO' ) || ! ACF_PRO ) : ?>
<a target="_blank" href="https://www.advancedcustomfields.com/pro/?utm_source=ACF%2BFree&utm_medium=insideplugin&utm_campaign=ACF%2Bupgrade" class="btn-upgrade">
<img src="<?php echo acf_get_url( 'assets/images/icon-upgrade-pro.svg' ); ?>" />
<p><?php _e( 'Upgrade to Pro', 'acf' ); ?></p>
</a>
<?php endif; ?>
</div>
<?php
/**
* Network Admin Database Upgrade
*
* Shows the databse upgrade process.
*
* @date 24/8/18
* @since 5.7.4
* @param void
*/
?>
<style type="text/css">
/* hide steps */
.show-on-complete {
display: none;
}
</style>
<div id="acf-upgrade-wrap" class="wrap">
<h1><?php _e( 'Upgrade Database', 'acf' ); ?></h1>
<p><?php echo sprintf( __( 'The following sites require a DB upgrade. Check the ones you want to update and then click %s.', 'acf' ), '"' . __( 'Upgrade Sites', 'acf' ) . '"' ); ?></p>
<p><input type="submit" name="upgrade" value="<?php _e( 'Upgrade Sites', 'acf' ); ?>" class="button" id="upgrade-sites"></p>
<table class="wp-list-table widefat">
<thead>
<tr>
<td class="manage-column check-column" scope="col">
<input type="checkbox" id="sites-select-all">
</td>
<th class="manage-column" scope="col" style="width:33%;">
<label for="sites-select-all"><?php _e( 'Site', 'acf' ); ?></label>
</th>
<th><?php _e( 'Description', 'acf' ); ?></th>
</tr>
</thead>
<tfoot>
<tr>
<td class="manage-column check-column" scope="col">
<input type="checkbox" id="sites-select-all-2">
</td>
<th class="manage-column" scope="col">
<label for="sites-select-all-2"><?php _e( 'Site', 'acf' ); ?></label>
</th>
<th><?php _e( 'Description', 'acf' ); ?></th>
</tr>
</tfoot>
<tbody id="the-list">
<?php
$sites = acf_get_sites();
if ( $sites ) :
foreach ( $sites as $i => $site ) :
// switch blog
switch_to_blog( $site['blog_id'] );
?>
<tr
<?php
if ( $i % 2 == 0 ) :
?>
class="alternate"<?php endif; ?>>
<th class="check-column" scope="row">
<?php if ( acf_has_upgrade() ) : ?>
<input type="checkbox" value="<?php echo $site['blog_id']; ?>" name="checked[]">
<?php endif; ?>
</th>
<td>
<strong><?php echo get_bloginfo( 'name' ); ?></strong><br /><?php echo home_url(); ?>
</td>
<td>
<?php if ( acf_has_upgrade() ) : ?>
<span class="response"><?php printf( __( 'Site requires database upgrade from %1$s to %2$s', 'acf' ), acf_get_db_version(), ACF_VERSION ); ?></span>
<?php else : ?>
<?php _e( 'Site is up to date', 'acf' ); ?>
<?php endif; ?>
</td>
</tr>
<?php
// restore
restore_current_blog();
endforeach;
endif;
?>
</tbody>
</table>
<p><input type="submit" name="upgrade" value="<?php _e( 'Upgrade Sites', 'acf' ); ?>" class="button" id="upgrade-sites-2"></p>
<p class="show-on-complete"><?php echo sprintf( __( 'Database Upgrade complete. <a href="%s">Return to network dashboard</a>', 'acf' ), network_admin_url() ); ?></p>
<script type="text/javascript">
(function($) {
var upgrader = new acf.Model({
events: {
'click #upgrade-sites': 'onClick',
'click #upgrade-sites-2': 'onClick'
},
$inputs: function(){
return $('#the-list input:checked');
},
onClick: function( e, $el ){
// prevent default
e.preventDefault();
// bail early if no selection
if( !this.$inputs().length ) {
return alert('<?php _e( 'Please select at least one site to upgrade.', 'acf' ); ?>');
}
// confirm action
if( !confirm("<?php _e( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf' ); ?>") ) {
return;
}
// upgrade
this.upgrade();
},
upgrade: function(){
// vars
var $inputs = this.$inputs();
// bail early if no sites selected
if( !$inputs.length ) {
return this.complete();
}
// disable buttons
$('.button').prop('disabled', true);
// vars
var $input = $inputs.first();
var $row = $input.closest('tr');
var text = '';
var success = false;
// show loading
$row.find('.response').html('<i class="acf-loading"></i></span> <?php printf( __( 'Upgrading data to version %s', 'acf' ), ACF_VERSION ); ?>');
// send ajax request to upgrade DB
$.ajax({
url: acf.get('ajaxurl'),
dataType: 'json',
type: 'post',
data: acf.prepareForAjax({
action: 'acf/ajax/upgrade',
blog_id: $input.val()
}),
success: function( json ){
success = true;
$input.remove();
text = '<?php _e( 'Upgrade complete.', 'acf' ); ?>';
},
error: function( jqXHR, textStatus, errorThrown ){
text = '<?php _e( 'Upgrade failed.', 'acf' ); ?>';
if( error = acf.getXhrError(jqXHR) ) {
text += ' <code>' + error + '</code>';
}
},
complete: this.proxy(function(){
// display text
$row.find('.response').html( text );
// if successful upgrade, proceed to next site. Otherwise, skip to complete.
if( success ) {
this.upgrade();
} else {
this.complete();
}
})
});
},
complete: function(){
// enable buttons
$('.button').prop('disabled', false);
// show message
$('.show-on-complete').show();
}
});
})(jQuery);
</script>
</div>
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.