c35162d4 by Jeff Balicki

advanced-custom-fields-pro

Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent 6b24bcf6
Showing 188 changed files with 442 additions and 251 deletions
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 * Plugin Name: Advanced Custom Fields PRO 9 * Plugin Name: Advanced Custom Fields PRO
10 * Plugin URI: https://www.advancedcustomfields.com 10 * Plugin URI: https://www.advancedcustomfields.com
11 * Description: Customize WordPress with powerful, professional and intuitive fields. 11 * Description: Customize WordPress with powerful, professional and intuitive fields.
12 * Version: 6.1.3 12 * Version: 6.1.6
13 * Author: WP Engine 13 * Author: WP Engine
14 * Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields 14 * Author URI: https://wpengine.com/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=plugin_directory&utm_content=advanced_custom_fields
15 * Update URI: https://www.advancedcustomfields.com/pro 15 * Update URI: https://www.advancedcustomfields.com/pro
...@@ -34,7 +34,7 @@ if ( ! class_exists( 'ACF' ) ) { ...@@ -34,7 +34,7 @@ if ( ! class_exists( 'ACF' ) ) {
34 * 34 *
35 * @var string 35 * @var string
36 */ 36 */
37 public $version = '6.1.3'; 37 public $version = '6.1.6';
38 38
39 /** 39 /**
40 * The plugin settings array. 40 * The plugin settings array.
......
...@@ -1171,6 +1171,12 @@ html[dir=rtl] .acf-field-object.open > .handle { ...@@ -1171,6 +1171,12 @@ html[dir=rtl] .acf-field-object.open > .handle {
1171 width: 18px; 1171 width: 18px;
1172 height: 18px; 1172 height: 18px;
1173 } 1173 }
1174 .acf-admin-page .acf-field-setting-type .select2-container.-acf,
1175 .acf-admin-page .acf-field-permalink-rewrite .select2-container.-acf,
1176 .acf-admin-page .acf-field-query-var .select2-container.-acf,
1177 .acf-admin-page .acf-field-meta-box .select2-container.-acf {
1178 min-height: 40px;
1179 }
1174 .acf-admin-page .acf-field-setting-type .select2-container--default .select2-selection--single .select2-selection__rendered, 1180 .acf-admin-page .acf-field-setting-type .select2-container--default .select2-selection--single .select2-selection__rendered,
1175 .acf-admin-page .acf-field-permalink-rewrite .select2-container--default .select2-selection--single .select2-selection__rendered, 1181 .acf-admin-page .acf-field-permalink-rewrite .select2-container--default .select2-selection--single .select2-selection__rendered,
1176 .acf-admin-page .acf-field-query-var .select2-container--default .select2-selection--single .select2-selection__rendered, 1182 .acf-admin-page .acf-field-query-var .select2-container--default .select2-selection--single .select2-selection__rendered,
...@@ -1287,7 +1293,7 @@ html[dir=rtl] .acf-field-object.open > .handle { ...@@ -1287,7 +1293,7 @@ html[dir=rtl] .acf-field-object.open > .handle {
1287 .acf-admin-page .field-type-select-results { 1293 .acf-admin-page .field-type-select-results {
1288 position: relative; 1294 position: relative;
1289 top: 4px; 1295 top: 4px;
1290 z-index: 600; 1296 z-index: 1002;
1291 border-radius: 0 0 6px 6px; 1297 border-radius: 0 0 6px 6px;
1292 box-shadow: 0px 8px 24px 4px rgba(16, 24, 40, 0.12); 1298 box-shadow: 0px 8px 24px 4px rgba(16, 24, 40, 0.12);
1293 } 1299 }
...@@ -1926,11 +1932,11 @@ html[dir=rtl] .acf-field-object.open > .handle { ...@@ -1926,11 +1932,11 @@ html[dir=rtl] .acf-field-object.open > .handle {
1926 border-bottom-width: 3px; 1932 border-bottom-width: 3px;
1927 } 1933 }
1928 1934
1929 .acf-field-editor .acf-field-settings-tab-bar { 1935 .acf-admin-page.acf-internal-post-type .acf-field-editor .acf-field-settings-tab-bar {
1930 padding-left: 72px; 1936 padding-left: 72px;
1931 } 1937 }
1932 @media screen and (max-width: 600px) { 1938 @media screen and (max-width: 600px) {
1933 .acf-field-editor .acf-field-settings-tab-bar { 1939 .acf-admin-page.acf-internal-post-type .acf-field-editor .acf-field-settings-tab-bar {
1934 padding-left: 12px; 1940 padding-left: 12px;
1935 } 1941 }
1936 } 1942 }
...@@ -2429,8 +2435,9 @@ html[dir=rtl] .acf-field-object.open > .handle { ...@@ -2429,8 +2435,9 @@ html[dir=rtl] .acf-field-object.open > .handle {
2429 min-height: 88px; 2435 min-height: 88px;
2430 margin-right: -24px; 2436 margin-right: -24px;
2431 margin-left: -24px; 2437 margin-left: -24px;
2432 padding-right: 48px; 2438 margin-bottom: -24px;
2433 padding-left: 48px; 2439 padding-right: 24px;
2440 padding-left: 24px;
2434 border-top-width: 1px; 2441 border-top-width: 1px;
2435 border-top-style: solid; 2442 border-top-style: solid;
2436 border-top-color: #EAECF0; 2443 border-top-color: #EAECF0;
......
...@@ -2872,6 +2872,12 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td { ...@@ -2872,6 +2872,12 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
2872 width: 18px; 2872 width: 18px;
2873 height: 18px; 2873 height: 18px;
2874 } 2874 }
2875 .acf-admin-page .acf-field-setting-type .select2-container.-acf,
2876 .acf-admin-page .acf-field-permalink-rewrite .select2-container.-acf,
2877 .acf-admin-page .acf-field-query-var .select2-container.-acf,
2878 .acf-admin-page .acf-field-meta-box .select2-container.-acf {
2879 min-height: 40px;
2880 }
2875 .acf-admin-page .acf-field-setting-type .select2-container--default .select2-selection--single .select2-selection__rendered, 2881 .acf-admin-page .acf-field-setting-type .select2-container--default .select2-selection--single .select2-selection__rendered,
2876 .acf-admin-page .acf-field-permalink-rewrite .select2-container--default .select2-selection--single .select2-selection__rendered, 2882 .acf-admin-page .acf-field-permalink-rewrite .select2-container--default .select2-selection--single .select2-selection__rendered,
2877 .acf-admin-page .acf-field-query-var .select2-container--default .select2-selection--single .select2-selection__rendered, 2883 .acf-admin-page .acf-field-query-var .select2-container--default .select2-selection--single .select2-selection__rendered,
...@@ -2988,7 +2994,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td { ...@@ -2988,7 +2994,7 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
2988 .acf-admin-page .field-type-select-results { 2994 .acf-admin-page .field-type-select-results {
2989 position: relative; 2995 position: relative;
2990 top: 4px; 2996 top: 4px;
2991 z-index: 600; 2997 z-index: 1002;
2992 border-radius: 0 0 6px 6px; 2998 border-radius: 0 0 6px 6px;
2993 box-shadow: 0px 8px 24px 4px rgba(16, 24, 40, 0.12); 2999 box-shadow: 0px 8px 24px 4px rgba(16, 24, 40, 0.12);
2994 } 3000 }
...@@ -3224,6 +3230,10 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td { ...@@ -3224,6 +3230,10 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
3224 font-size: 10px; 3230 font-size: 10px;
3225 color: #475467; 3231 color: #475467;
3226 } 3232 }
3233 .acf-internal-post-type .wp-list-table th .acf-emdash,
3234 .acf-internal-post-type .wp-list-table td .acf-emdash {
3235 color: #D0D5DD;
3236 }
3227 .acf-internal-post-type .wp-list-table thead th, .acf-internal-post-type .wp-list-table thead td, 3237 .acf-internal-post-type .wp-list-table thead th, .acf-internal-post-type .wp-list-table thead td,
3228 .acf-internal-post-type .wp-list-table tfoot th, .acf-internal-post-type .wp-list-table tfoot td { 3238 .acf-internal-post-type .wp-list-table tfoot th, .acf-internal-post-type .wp-list-table tfoot td {
3229 height: 48px; 3239 height: 48px;
...@@ -3454,6 +3464,9 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td { ...@@ -3454,6 +3464,9 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
3454 display: flex; 3464 display: flex;
3455 align-items: center; 3465 align-items: center;
3456 } 3466 }
3467 .acf-internal-post-type .tablenav-pages.no-pages {
3468 display: none;
3469 }
3457 .acf-internal-post-type .tablenav-pages .displaying-num { 3470 .acf-internal-post-type .tablenav-pages .displaying-num {
3458 margin-top: 0; 3471 margin-top: 0;
3459 margin-right: 16px; 3472 margin-right: 16px;
...@@ -3716,10 +3729,9 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td { ...@@ -3716,10 +3729,9 @@ html[dir=rtl] .acf-table > tbody > tr > td.order + td {
3716 .acf-no-taxonomies .wp-list-table tfoot { 3729 .acf-no-taxonomies .wp-list-table tfoot {
3717 display: none; 3730 display: none;
3718 } 3731 }
3719 .acf-no-field-groups .no-pages, 3732
3720 .acf-no-post-types .no-pages, 3733 .acf-internal-post-type #the-list .no-items td {
3721 .acf-no-taxonomies .no-pages { 3734 vertical-align: middle;
3722 display: none;
3723 } 3735 }
3724 3736
3725 /*--------------------------------------------------------------------------------------------- 3737 /*---------------------------------------------------------------------------------------------
......
...@@ -668,7 +668,6 @@ html[dir=rtl] input.acf-is-prepended.acf-is-appended { ...@@ -668,7 +668,6 @@ html[dir=rtl] input.acf-is-prepended.acf-is-appended {
668 * 668 *
669 *-----------------------------------------------------------------------------*/ 669 *-----------------------------------------------------------------------------*/
670 .select2-container.-acf { 670 .select2-container.-acf {
671 min-height: 40px;
672 z-index: 1001; 671 z-index: 1001;
673 /* open */ 672 /* open */
674 /* single open */ 673 /* single open */
...@@ -2224,7 +2223,8 @@ html[dir=rtl] .acf-file-uploader .file-info { ...@@ -2224,7 +2223,8 @@ html[dir=rtl] .acf-file-uploader .file-info {
2224 } 2223 }
2225 .acf-range-wrap input[type=number] { 2224 .acf-range-wrap input[type=number] {
2226 display: inline-block; 2225 display: inline-block;
2227 min-width: 3em; 2226 min-width: 5em;
2227 padding-right: 4px;
2228 margin-left: 10px; 2228 margin-left: 10px;
2229 vertical-align: middle; 2229 vertical-align: middle;
2230 } 2230 }
......
1 /******/ (() => { // webpackBootstrap 1 /******/ (function() { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({ 2 /******/ var __webpack_modules__ = ({
3 3
4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-internal-post-type.js": 4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-internal-post-type.js":
5 /*!*********************************************************************************!*\ 5 /*!*********************************************************************************!*\
6 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-internal-post-type.js ***! 6 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-internal-post-type.js ***!
7 \*********************************************************************************/ 7 \*********************************************************************************/
8 /***/ (() => { 8 /***/ (function() {
9 9
10 (function ($, undefined) { 10 (function ($, undefined) {
11 /** 11 /**
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
17 */ 17 */
18 const internalPostTypeSettingsManager = new acf.Model({ 18 const internalPostTypeSettingsManager = new acf.Model({
19 id: 'internalPostTypeSettingsManager', 19 id: 'internalPostTypeSettingsManager',
20 wait: 'ready',
20 events: { 21 events: {
21 'blur .acf_slugify_to_key': 'onChangeSlugify', 22 'blur .acf_slugify_to_key': 'onChangeSlugify',
22 'blur .acf_singular_label': 'onChangeSingularLabel', 23 'blur .acf_singular_label': 'onChangeSingularLabel',
...@@ -25,20 +26,23 @@ ...@@ -25,20 +26,23 @@
25 'click .acf-regenerate-labels': 'onClickRegenerateLabels', 26 'click .acf-regenerate-labels': 'onClickRegenerateLabels',
26 'click .acf-clear-labels': 'onClickClearLabels', 27 'click .acf-clear-labels': 'onClickClearLabels',
27 'change .rewrite_slug_field': 'onChangeURLSlug', 28 'change .rewrite_slug_field': 'onChangeURLSlug',
28 'keyup .rewrite_slug_field': 'onChangeURLSlug', 29 'keyup .rewrite_slug_field': 'onChangeURLSlug'
29 ready: 'ready'
30 }, 30 },
31 onChangeSlugify: function (e, $el) { 31 onChangeSlugify: function (e, $el) {
32 const name = $el.val(); 32 const name = $el.val();
33 const $keyInput = $('.acf_slugified_key'); 33 const $keyInput = $('.acf_slugified_key');
34 34
35 // render name 35 // generate field key.
36 if ($keyInput.val().trim() == '') { 36 if ($keyInput.val().trim() == '') {
37 var slug = acf.applyFilters('generate_internal_post_type_name', acf.strSanitize(name), this); 37 let slug = acf.strSanitize(name.trim()).replaceAll('_', '-');
38 slug = acf.applyFilters('generate_internal_post_type_name', slug, this);
38 $keyInput.val(slug.substring(0, 20)); 39 $keyInput.val(slug.substring(0, 20));
39 } 40 }
40 }, 41 },
41 ready: function () { 42 initialize: function () {
43 // check we should init.
44 if (!['taxonomy', 'post_type'].includes(acf.get('screen'))) return;
45
42 // select2 46 // select2
43 const template = function (selection) { 47 const template = function (selection) {
44 if ('undefined' === typeof selection.element) { 48 if ('undefined' === typeof selection.element) {
...@@ -302,49 +306,49 @@ ...@@ -302,49 +306,49 @@
302 /******/ 306 /******/
303 /************************************************************************/ 307 /************************************************************************/
304 /******/ /* webpack/runtime/compat get default export */ 308 /******/ /* webpack/runtime/compat get default export */
305 /******/ (() => { 309 /******/ !function() {
306 /******/ // getDefaultExport function for compatibility with non-harmony modules 310 /******/ // getDefaultExport function for compatibility with non-harmony modules
307 /******/ __webpack_require__.n = (module) => { 311 /******/ __webpack_require__.n = function(module) {
308 /******/ var getter = module && module.__esModule ? 312 /******/ var getter = module && module.__esModule ?
309 /******/ () => (module['default']) : 313 /******/ function() { return module['default']; } :
310 /******/ () => (module); 314 /******/ function() { return module; };
311 /******/ __webpack_require__.d(getter, { a: getter }); 315 /******/ __webpack_require__.d(getter, { a: getter });
312 /******/ return getter; 316 /******/ return getter;
313 /******/ }; 317 /******/ };
314 /******/ })(); 318 /******/ }();
315 /******/ 319 /******/
316 /******/ /* webpack/runtime/define property getters */ 320 /******/ /* webpack/runtime/define property getters */
317 /******/ (() => { 321 /******/ !function() {
318 /******/ // define getter functions for harmony exports 322 /******/ // define getter functions for harmony exports
319 /******/ __webpack_require__.d = (exports, definition) => { 323 /******/ __webpack_require__.d = function(exports, definition) {
320 /******/ for(var key in definition) { 324 /******/ for(var key in definition) {
321 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 325 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
322 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 326 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
323 /******/ } 327 /******/ }
324 /******/ } 328 /******/ }
325 /******/ }; 329 /******/ };
326 /******/ })(); 330 /******/ }();
327 /******/ 331 /******/
328 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 332 /******/ /* webpack/runtime/hasOwnProperty shorthand */
329 /******/ (() => { 333 /******/ !function() {
330 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 334 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
331 /******/ })(); 335 /******/ }();
332 /******/ 336 /******/
333 /******/ /* webpack/runtime/make namespace object */ 337 /******/ /* webpack/runtime/make namespace object */
334 /******/ (() => { 338 /******/ !function() {
335 /******/ // define __esModule on exports 339 /******/ // define __esModule on exports
336 /******/ __webpack_require__.r = (exports) => { 340 /******/ __webpack_require__.r = function(exports) {
337 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 341 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
338 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 342 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
339 /******/ } 343 /******/ }
340 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 344 /******/ Object.defineProperty(exports, '__esModule', { value: true });
341 /******/ }; 345 /******/ };
342 /******/ })(); 346 /******/ }();
343 /******/ 347 /******/
344 /************************************************************************/ 348 /************************************************************************/
345 var __webpack_exports__ = {}; 349 var __webpack_exports__ = {};
346 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 350 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
347 (() => { 351 !function() {
348 "use strict"; 352 "use strict";
349 /*!********************************************************************************!*\ 353 /*!********************************************************************************!*\
350 !*** ./src/advanced-custom-fields-pro/assets/src/js/acf-internal-post-type.js ***! 354 !*** ./src/advanced-custom-fields-pro/assets/src/js/acf-internal-post-type.js ***!
...@@ -353,8 +357,7 @@ __webpack_require__.r(__webpack_exports__); ...@@ -353,8 +357,7 @@ __webpack_require__.r(__webpack_exports__);
353 /* harmony import */ var _acf_internal_post_type_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_acf-internal-post-type.js */ "./src/advanced-custom-fields-pro/assets/src/js/_acf-internal-post-type.js"); 357 /* harmony import */ var _acf_internal_post_type_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_acf-internal-post-type.js */ "./src/advanced-custom-fields-pro/assets/src/js/_acf-internal-post-type.js");
354 /* harmony import */ var _acf_internal_post_type_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_acf_internal_post_type_js__WEBPACK_IMPORTED_MODULE_0__); 358 /* harmony import */ var _acf_internal_post_type_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_acf_internal_post_type_js__WEBPACK_IMPORTED_MODULE_0__);
355 359
356 })(); 360 }();
357
358 /******/ })() 361 /******/ })()
359 ; 362 ;
360 //# sourceMappingURL=acf-internal-post-type.js.map 363 //# sourceMappingURL=acf-internal-post-type.js.map
...\ No newline at end of file ...\ No newline at end of file
......
1 /******/ (() => { // webpackBootstrap 1 /******/ (function() { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({ 2 /******/ var __webpack_modules__ = ({
3 3
4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-hooks.js": 4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/_acf-hooks.js":
5 /*!********************************************************************!*\ 5 /*!********************************************************************!*\
6 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-hooks.js ***! 6 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-hooks.js ***!
7 \********************************************************************/ 7 \********************************************************************/
8 /***/ (() => { 8 /***/ (function() {
9 9
10 (function (window, undefined) { 10 (function (window, undefined) {
11 'use strict'; 11 'use strict';
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
249 /*!********************************************************************!*\ 249 /*!********************************************************************!*\
250 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-modal.js ***! 250 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-modal.js ***!
251 \********************************************************************/ 251 \********************************************************************/
252 /***/ (() => { 252 /***/ (function() {
253 253
254 (function ($, undefined) { 254 (function ($, undefined) {
255 acf.models.Modal = acf.Model.extend({ 255 acf.models.Modal = acf.Model.extend({
...@@ -360,7 +360,7 @@ ...@@ -360,7 +360,7 @@
360 /*!********************************************************************!*\ 360 /*!********************************************************************!*\
361 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-model.js ***! 361 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-model.js ***!
362 \********************************************************************/ 362 \********************************************************************/
363 /***/ (() => { 363 /***/ (function() {
364 364
365 (function ($, undefined) { 365 (function ($, undefined) {
366 // Cached regex to split keys for `addEvent`. 366 // Cached regex to split keys for `addEvent`.
...@@ -1228,7 +1228,7 @@ ...@@ -1228,7 +1228,7 @@
1228 /*!*********************************************************************!*\ 1228 /*!*********************************************************************!*\
1229 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-notice.js ***! 1229 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-notice.js ***!
1230 \*********************************************************************/ 1230 \*********************************************************************/
1231 /***/ (() => { 1231 /***/ (function() {
1232 1232
1233 (function ($, undefined) { 1233 (function ($, undefined) {
1234 var Notice = acf.Model.extend({ 1234 var Notice = acf.Model.extend({
...@@ -1375,7 +1375,7 @@ ...@@ -1375,7 +1375,7 @@
1375 /*!********************************************************************!*\ 1375 /*!********************************************************************!*\
1376 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-panel.js ***! 1376 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-panel.js ***!
1377 \********************************************************************/ 1377 \********************************************************************/
1378 /***/ (() => { 1378 /***/ (function() {
1379 1379
1380 (function ($, undefined) { 1380 (function ($, undefined) {
1381 var panel = new acf.Model({ 1381 var panel = new acf.Model({
...@@ -1409,7 +1409,7 @@ ...@@ -1409,7 +1409,7 @@
1409 /*!********************************************************************!*\ 1409 /*!********************************************************************!*\
1410 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-popup.js ***! 1410 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-popup.js ***!
1411 \********************************************************************/ 1411 \********************************************************************/
1412 /***/ (() => { 1412 /***/ (function() {
1413 1413
1414 (function ($, undefined) { 1414 (function ($, undefined) {
1415 acf.models.Popup = acf.Model.extend({ 1415 acf.models.Popup = acf.Model.extend({
...@@ -1550,7 +1550,7 @@ ...@@ -1550,7 +1550,7 @@
1550 /*!**********************************************************************!*\ 1550 /*!**********************************************************************!*\
1551 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-tooltip.js ***! 1551 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf-tooltip.js ***!
1552 \**********************************************************************/ 1552 \**********************************************************************/
1553 /***/ (() => { 1553 /***/ (function() {
1554 1554
1555 (function ($, undefined) { 1555 (function ($, undefined) {
1556 acf.newTooltip = function (props) { 1556 acf.newTooltip = function (props) {
...@@ -1853,7 +1853,7 @@ ...@@ -1853,7 +1853,7 @@
1853 /*!**************************************************************!*\ 1853 /*!**************************************************************!*\
1854 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf.js ***! 1854 !*** ./src/advanced-custom-fields-pro/assets/src/js/_acf.js ***!
1855 \**************************************************************/ 1855 \**************************************************************/
1856 /***/ (() => { 1856 /***/ (function() {
1857 1857
1858 (function ($, undefined) { 1858 (function ($, undefined) {
1859 /** 1859 /**
...@@ -3193,6 +3193,18 @@ ...@@ -3193,6 +3193,18 @@
3193 $el2.removeClass('acf-clone'); 3193 $el2.removeClass('acf-clone');
3194 $el2.find('.ui-sortable').removeClass('ui-sortable'); 3194 $el2.find('.ui-sortable').removeClass('ui-sortable');
3195 3195
3196 // remove any initialised select2s prevent the duplicated object stealing the previous select2.
3197 $el2.find('[data-select2-id]').removeAttr('data-select2-id');
3198 $el2.find('.select2').remove();
3199
3200 // subfield select2 renames happen after init and contain a duplicated ID. force change those IDs to prevent this.
3201 $el2.find('.acf-is-subfields select[data-ui="1"]').each(function () {
3202 $(this).prop('id', $(this).prop('id').replace('acf_fields', acf.uniqid('duplicated_') + '_acf_fields'));
3203 });
3204
3205 // remove tab wrapper to ensure proper init
3206 $el2.find('.acf-field-settings > .acf-tab-wrap').remove();
3207
3196 // after 3208 // after
3197 // - allow acf to modify DOM 3209 // - allow acf to modify DOM
3198 args.after($el, $el2); 3210 args.after($el, $el2);
...@@ -4368,49 +4380,49 @@ ...@@ -4368,49 +4380,49 @@
4368 /******/ 4380 /******/
4369 /************************************************************************/ 4381 /************************************************************************/
4370 /******/ /* webpack/runtime/compat get default export */ 4382 /******/ /* webpack/runtime/compat get default export */
4371 /******/ (() => { 4383 /******/ !function() {
4372 /******/ // getDefaultExport function for compatibility with non-harmony modules 4384 /******/ // getDefaultExport function for compatibility with non-harmony modules
4373 /******/ __webpack_require__.n = (module) => { 4385 /******/ __webpack_require__.n = function(module) {
4374 /******/ var getter = module && module.__esModule ? 4386 /******/ var getter = module && module.__esModule ?
4375 /******/ () => (module['default']) : 4387 /******/ function() { return module['default']; } :
4376 /******/ () => (module); 4388 /******/ function() { return module; };
4377 /******/ __webpack_require__.d(getter, { a: getter }); 4389 /******/ __webpack_require__.d(getter, { a: getter });
4378 /******/ return getter; 4390 /******/ return getter;
4379 /******/ }; 4391 /******/ };
4380 /******/ })(); 4392 /******/ }();
4381 /******/ 4393 /******/
4382 /******/ /* webpack/runtime/define property getters */ 4394 /******/ /* webpack/runtime/define property getters */
4383 /******/ (() => { 4395 /******/ !function() {
4384 /******/ // define getter functions for harmony exports 4396 /******/ // define getter functions for harmony exports
4385 /******/ __webpack_require__.d = (exports, definition) => { 4397 /******/ __webpack_require__.d = function(exports, definition) {
4386 /******/ for(var key in definition) { 4398 /******/ for(var key in definition) {
4387 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 4399 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
4388 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 4400 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
4389 /******/ } 4401 /******/ }
4390 /******/ } 4402 /******/ }
4391 /******/ }; 4403 /******/ };
4392 /******/ })(); 4404 /******/ }();
4393 /******/ 4405 /******/
4394 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 4406 /******/ /* webpack/runtime/hasOwnProperty shorthand */
4395 /******/ (() => { 4407 /******/ !function() {
4396 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 4408 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
4397 /******/ })(); 4409 /******/ }();
4398 /******/ 4410 /******/
4399 /******/ /* webpack/runtime/make namespace object */ 4411 /******/ /* webpack/runtime/make namespace object */
4400 /******/ (() => { 4412 /******/ !function() {
4401 /******/ // define __esModule on exports 4413 /******/ // define __esModule on exports
4402 /******/ __webpack_require__.r = (exports) => { 4414 /******/ __webpack_require__.r = function(exports) {
4403 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 4415 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
4404 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 4416 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4405 /******/ } 4417 /******/ }
4406 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 4418 /******/ Object.defineProperty(exports, '__esModule', { value: true });
4407 /******/ }; 4419 /******/ };
4408 /******/ })(); 4420 /******/ }();
4409 /******/ 4421 /******/
4410 /************************************************************************/ 4422 /************************************************************************/
4411 var __webpack_exports__ = {}; 4423 var __webpack_exports__ = {};
4412 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 4424 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
4413 (() => { 4425 !function() {
4414 "use strict"; 4426 "use strict";
4415 /*!*************************************************************!*\ 4427 /*!*************************************************************!*\
4416 !*** ./src/advanced-custom-fields-pro/assets/src/js/acf.js ***! 4428 !*** ./src/advanced-custom-fields-pro/assets/src/js/acf.js ***!
...@@ -4440,8 +4452,7 @@ __webpack_require__.r(__webpack_exports__); ...@@ -4440,8 +4452,7 @@ __webpack_require__.r(__webpack_exports__);
4440 4452
4441 4453
4442 4454
4443 })(); 4455 }();
4444
4445 /******/ })() 4456 /******/ })()
4446 ; 4457 ;
4447 //# sourceMappingURL=acf.js.map 4458 //# sourceMappingURL=acf.js.map
...\ No newline at end of file ...\ No newline at end of file
......
1 /******/ (() => { // webpackBootstrap 1 /******/ (function() { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({ 2 /******/ var __webpack_modules__ = ({
3 3
4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-clone.js": 4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-clone.js":
5 /*!********************************************************************************!*\ 5 /*!********************************************************************************!*\
6 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-clone.js ***! 6 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-clone.js ***!
7 \********************************************************************************/ 7 \********************************************************************************/
8 /***/ (() => { 8 /***/ (function() {
9 9
10 (function ($) { 10 (function ($) {
11 /** 11 /**
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
152 /*!*******************************************************************************************!*\ 152 /*!*******************************************************************************************!*\
153 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-flexible-content.js ***! 153 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-flexible-content.js ***!
154 \*******************************************************************************************/ 154 \*******************************************************************************************/
155 /***/ (() => { 155 /***/ (function() {
156 156
157 (function ($) { 157 (function ($) {
158 /** 158 /**
...@@ -352,6 +352,11 @@ ...@@ -352,6 +352,11 @@
352 // wipe field 352 // wipe field
353 child.wipe(); 353 child.wipe();
354 354
355 // if the child is open, re-fire the open method to ensure it's initialised correctly.
356 if (child.isOpen()) {
357 child.open();
358 }
359
355 // update parent 360 // update parent
356 child.updateParent(); 361 child.updateParent();
357 }); 362 });
...@@ -465,7 +470,7 @@ ...@@ -465,7 +470,7 @@
465 /*!***********************************************************************************!*\ 470 /*!***********************************************************************************!*\
466 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-repeater.js ***! 471 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-setting-repeater.js ***!
467 \***********************************************************************************/ 472 \***********************************************************************************/
468 /***/ (() => { 473 /***/ (function() {
469 474
470 (function ($) { 475 (function ($) {
471 /* 476 /*
...@@ -551,49 +556,49 @@ ...@@ -551,49 +556,49 @@
551 /******/ 556 /******/
552 /************************************************************************/ 557 /************************************************************************/
553 /******/ /* webpack/runtime/compat get default export */ 558 /******/ /* webpack/runtime/compat get default export */
554 /******/ (() => { 559 /******/ !function() {
555 /******/ // getDefaultExport function for compatibility with non-harmony modules 560 /******/ // getDefaultExport function for compatibility with non-harmony modules
556 /******/ __webpack_require__.n = (module) => { 561 /******/ __webpack_require__.n = function(module) {
557 /******/ var getter = module && module.__esModule ? 562 /******/ var getter = module && module.__esModule ?
558 /******/ () => (module['default']) : 563 /******/ function() { return module['default']; } :
559 /******/ () => (module); 564 /******/ function() { return module; };
560 /******/ __webpack_require__.d(getter, { a: getter }); 565 /******/ __webpack_require__.d(getter, { a: getter });
561 /******/ return getter; 566 /******/ return getter;
562 /******/ }; 567 /******/ };
563 /******/ })(); 568 /******/ }();
564 /******/ 569 /******/
565 /******/ /* webpack/runtime/define property getters */ 570 /******/ /* webpack/runtime/define property getters */
566 /******/ (() => { 571 /******/ !function() {
567 /******/ // define getter functions for harmony exports 572 /******/ // define getter functions for harmony exports
568 /******/ __webpack_require__.d = (exports, definition) => { 573 /******/ __webpack_require__.d = function(exports, definition) {
569 /******/ for(var key in definition) { 574 /******/ for(var key in definition) {
570 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 575 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
571 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 576 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
572 /******/ } 577 /******/ }
573 /******/ } 578 /******/ }
574 /******/ }; 579 /******/ };
575 /******/ })(); 580 /******/ }();
576 /******/ 581 /******/
577 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 582 /******/ /* webpack/runtime/hasOwnProperty shorthand */
578 /******/ (() => { 583 /******/ !function() {
579 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 584 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
580 /******/ })(); 585 /******/ }();
581 /******/ 586 /******/
582 /******/ /* webpack/runtime/make namespace object */ 587 /******/ /* webpack/runtime/make namespace object */
583 /******/ (() => { 588 /******/ !function() {
584 /******/ // define __esModule on exports 589 /******/ // define __esModule on exports
585 /******/ __webpack_require__.r = (exports) => { 590 /******/ __webpack_require__.r = function(exports) {
586 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 591 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
587 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 592 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
588 /******/ } 593 /******/ }
589 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 594 /******/ Object.defineProperty(exports, '__esModule', { value: true });
590 /******/ }; 595 /******/ };
591 /******/ })(); 596 /******/ }();
592 /******/ 597 /******/
593 /************************************************************************/ 598 /************************************************************************/
594 var __webpack_exports__ = {}; 599 var __webpack_exports__ = {};
595 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 600 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
596 (() => { 601 !function() {
597 "use strict"; 602 "use strict";
598 /*!*********************************************************************************!*\ 603 /*!*********************************************************************************!*\
599 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/acf-pro-field-group.js ***! 604 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/acf-pro-field-group.js ***!
...@@ -608,8 +613,7 @@ __webpack_require__.r(__webpack_exports__); ...@@ -608,8 +613,7 @@ __webpack_require__.r(__webpack_exports__);
608 613
609 614
610 615
611 })(); 616 }();
612
613 /******/ })() 617 /******/ })()
614 ; 618 ;
615 //# sourceMappingURL=acf-pro-field-group.js.map 619 //# sourceMappingURL=acf-pro-field-group.js.map
...\ No newline at end of file ...\ No newline at end of file
......
1 /******/ (() => { // webpackBootstrap 1 /******/ (function() { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({ 2 /******/ var __webpack_modules__ = ({
3 3
4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-flexible-content.js": 4 /***/ "./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-flexible-content.js":
5 /*!*****************************************************************************************!*\ 5 /*!*****************************************************************************************!*\
6 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-flexible-content.js ***! 6 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-flexible-content.js ***!
7 \*****************************************************************************************/ 7 \*****************************************************************************************/
8 /***/ (() => { 8 /***/ (function() {
9 9
10 (function ($) { 10 (function ($) {
11 var Field = acf.Field.extend({ 11 var Field = acf.Field.extend({
...@@ -592,7 +592,7 @@ ...@@ -592,7 +592,7 @@
592 /*!********************************************************************************!*\ 592 /*!********************************************************************************!*\
593 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-gallery.js ***! 593 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-gallery.js ***!
594 \********************************************************************************/ 594 \********************************************************************************/
595 /***/ (() => { 595 /***/ (function() {
596 596
597 (function ($) { 597 (function ($) {
598 var Field = acf.Field.extend({ 598 var Field = acf.Field.extend({
...@@ -1157,7 +1157,7 @@ ...@@ -1157,7 +1157,7 @@
1157 /*!*********************************************************************************!*\ 1157 /*!*********************************************************************************!*\
1158 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-repeater.js ***! 1158 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/_acf-field-repeater.js ***!
1159 \*********************************************************************************/ 1159 \*********************************************************************************/
1160 /***/ (() => { 1160 /***/ (function() {
1161 1161
1162 (function ($) { 1162 (function ($) {
1163 var Field = acf.Field.extend({ 1163 var Field = acf.Field.extend({
...@@ -1583,7 +1583,7 @@ ...@@ -1583,7 +1583,7 @@
1583 1583
1584 // vars 1584 // vars
1585 var min = this.get('min'); 1585 var min = this.get('min');
1586 var text = acf.__('Minimum rows reached ({min} rows)'); 1586 var text = acf.__('Minimum rows not reached ({min} rows)');
1587 1587
1588 // replace 1588 // replace
1589 text = text.replace('{min}', min); 1589 text = text.replace('{min}', min);
...@@ -2038,49 +2038,49 @@ ...@@ -2038,49 +2038,49 @@
2038 /******/ 2038 /******/
2039 /************************************************************************/ 2039 /************************************************************************/
2040 /******/ /* webpack/runtime/compat get default export */ 2040 /******/ /* webpack/runtime/compat get default export */
2041 /******/ (() => { 2041 /******/ !function() {
2042 /******/ // getDefaultExport function for compatibility with non-harmony modules 2042 /******/ // getDefaultExport function for compatibility with non-harmony modules
2043 /******/ __webpack_require__.n = (module) => { 2043 /******/ __webpack_require__.n = function(module) {
2044 /******/ var getter = module && module.__esModule ? 2044 /******/ var getter = module && module.__esModule ?
2045 /******/ () => (module['default']) : 2045 /******/ function() { return module['default']; } :
2046 /******/ () => (module); 2046 /******/ function() { return module; };
2047 /******/ __webpack_require__.d(getter, { a: getter }); 2047 /******/ __webpack_require__.d(getter, { a: getter });
2048 /******/ return getter; 2048 /******/ return getter;
2049 /******/ }; 2049 /******/ };
2050 /******/ })(); 2050 /******/ }();
2051 /******/ 2051 /******/
2052 /******/ /* webpack/runtime/define property getters */ 2052 /******/ /* webpack/runtime/define property getters */
2053 /******/ (() => { 2053 /******/ !function() {
2054 /******/ // define getter functions for harmony exports 2054 /******/ // define getter functions for harmony exports
2055 /******/ __webpack_require__.d = (exports, definition) => { 2055 /******/ __webpack_require__.d = function(exports, definition) {
2056 /******/ for(var key in definition) { 2056 /******/ for(var key in definition) {
2057 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 2057 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
2058 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 2058 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
2059 /******/ } 2059 /******/ }
2060 /******/ } 2060 /******/ }
2061 /******/ }; 2061 /******/ };
2062 /******/ })(); 2062 /******/ }();
2063 /******/ 2063 /******/
2064 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 2064 /******/ /* webpack/runtime/hasOwnProperty shorthand */
2065 /******/ (() => { 2065 /******/ !function() {
2066 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 2066 /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
2067 /******/ })(); 2067 /******/ }();
2068 /******/ 2068 /******/
2069 /******/ /* webpack/runtime/make namespace object */ 2069 /******/ /* webpack/runtime/make namespace object */
2070 /******/ (() => { 2070 /******/ !function() {
2071 /******/ // define __esModule on exports 2071 /******/ // define __esModule on exports
2072 /******/ __webpack_require__.r = (exports) => { 2072 /******/ __webpack_require__.r = function(exports) {
2073 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 2073 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
2074 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 2074 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2075 /******/ } 2075 /******/ }
2076 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 2076 /******/ Object.defineProperty(exports, '__esModule', { value: true });
2077 /******/ }; 2077 /******/ };
2078 /******/ })(); 2078 /******/ }();
2079 /******/ 2079 /******/
2080 /************************************************************************/ 2080 /************************************************************************/
2081 var __webpack_exports__ = {}; 2081 var __webpack_exports__ = {};
2082 // This entry need to be wrapped in an IIFE because it need to be in strict mode. 2082 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
2083 (() => { 2083 !function() {
2084 "use strict"; 2084 "use strict";
2085 /*!***************************************************************************!*\ 2085 /*!***************************************************************************!*\
2086 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/acf-pro-input.js ***! 2086 !*** ./src/advanced-custom-fields-pro/assets/src/js/pro/acf-pro-input.js ***!
...@@ -2095,8 +2095,7 @@ __webpack_require__.r(__webpack_exports__); ...@@ -2095,8 +2095,7 @@ __webpack_require__.r(__webpack_exports__);
2095 2095
2096 2096
2097 2097
2098 })(); 2098 }();
2099
2100 /******/ })() 2099 /******/ })()
2101 ; 2100 ;
2102 //# sourceMappingURL=acf-pro-input.js.map 2101 //# sourceMappingURL=acf-pro-input.js.map
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -584,3 +584,39 @@ function acf_add_internal_post_type_validation_error( $name, $message = '' ) { ...@@ -584,3 +584,39 @@ function acf_add_internal_post_type_validation_error( $name, $message = '' ) {
584 584
585 return acf_add_validation_error( $name, $message ); 585 return acf_add_validation_error( $name, $message );
586 } 586 }
587
588 /**
589 * Gets an ACF post type from request args and verifies nonce based on action.
590 *
591 * @since 6.1.5
592 *
593 * @param string $action The action being performed.
594 * @return array|bool
595 */
596 function acf_get_post_type_from_request_args( $action = '' ) {
597 $acf_use_post_type = acf_request_arg( 'use_post_type', false );
598
599 if ( ! $acf_use_post_type || ! wp_verify_nonce( acf_request_arg( '_wpnonce' ), $action . '-' . $acf_use_post_type ) ) {
600 return false;
601 }
602
603 return acf_get_internal_post_type( (int) $acf_use_post_type, 'acf-post-type' );
604 }
605
606 /**
607 * Gets an ACF taxonomy from request args and verifies nonce based on action.
608 *
609 * @since 6.1.5
610 *
611 * @param string $action The action being performed.
612 * @return array|bool
613 */
614 function acf_get_taxonomy_from_request_args( $action = '' ) {
615 $acf_use_taxonomy = acf_request_arg( 'use_taxonomy', false );
616
617 if ( ! $acf_use_taxonomy || ! wp_verify_nonce( acf_request_arg( '_wpnonce' ), $action . '-' . $acf_use_taxonomy ) ) {
618 return false;
619 }
620
621 return acf_get_internal_post_type( (int) $acf_use_taxonomy, 'acf-taxonomy' );
622 }
......
...@@ -117,7 +117,7 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type_List' ) ) : ...@@ -117,7 +117,7 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type_List' ) ) :
117 } 117 }
118 118
119 // Get the current view. 119 // Get the current view.
120 $this->view = isset( $_GET['post_status'] ) ? sanitize_text_field( $_GET['post_status'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended 120 $this->view = acf_request_arg( 'post_status', '' );
121 121
122 // Setup and check for custom actions. 122 // Setup and check for custom actions.
123 $this->setup_sync(); 123 $this->setup_sync();
...@@ -222,10 +222,10 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type_List' ) ) : ...@@ -222,10 +222,10 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type_List' ) ) :
222 * @return string 222 * @return string
223 */ 223 */
224 public function admin_body_class( $classes ) { 224 public function admin_body_class( $classes ) {
225 $classes .= " acf-admin-page acf-internal-post-type {$this->admin_body_class}"; 225 $classes .= ' acf-admin-page acf-internal-post-type ' . esc_attr( $this->admin_body_class );
226 226
227 if ( $this->view ) { 227 if ( $this->view ) {
228 $classes .= " view-{$this->view}"; 228 $classes .= ' view-' . esc_attr( $this->view );
229 } 229 }
230 230
231 return $classes; 231 return $classes;
......
...@@ -111,8 +111,7 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type' ) ) : ...@@ -111,8 +111,7 @@ if ( ! class_exists( 'ACF_Admin_Internal_Post_Type' ) ) :
111 * @return string 111 * @return string
112 */ 112 */
113 public function admin_body_class( $classes ) { 113 public function admin_body_class( $classes ) {
114 $classes .= " acf-admin-page acf-internal-post-type {$this->admin_body_class}"; 114 return $classes . ' acf-admin-page acf-internal-post-type ' . esc_attr( $this->admin_body_class );
115 return $classes;
116 } 115 }
117 116
118 /** 117 /**
......
...@@ -70,7 +70,7 @@ if ( ! class_exists( 'ACF_Admin' ) ) : ...@@ -70,7 +70,7 @@ if ( ! class_exists( 'ACF_Admin' ) ) :
70 * @param string $classes Space-separated list of CSS classes. 70 * @param string $classes Space-separated list of CSS classes.
71 * @return string 71 * @return string
72 */ 72 */
73 function admin_body_class( $classes ) { 73 public function admin_body_class( $classes ) {
74 global $wp_version; 74 global $wp_version;
75 75
76 // Determine body class version. 76 // Determine body class version.
...@@ -82,7 +82,7 @@ if ( ! class_exists( 'ACF_Admin' ) ) : ...@@ -82,7 +82,7 @@ if ( ! class_exists( 'ACF_Admin' ) ) :
82 } 82 }
83 83
84 // Add browser for specific CSS. 84 // Add browser for specific CSS.
85 $classes .= ' acf-browser-' . acf_get_browser(); 85 $classes .= ' acf-browser-' . esc_attr( acf_get_browser() );
86 86
87 // Return classes. 87 // Return classes.
88 return $classes; 88 return $classes;
......
...@@ -127,6 +127,10 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) : ...@@ -127,6 +127,10 @@ if ( ! class_exists( 'acf_admin_field_group' ) ) :
127 'fieldCategoriesL10n' => acf_get_field_categories_i18n(), 127 'fieldCategoriesL10n' => acf_get_field_categories_i18n(),
128 'PROUpgradeURL' => acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/pro/', 'ACF upgrade', 'field-type-selection' ), 128 'PROUpgradeURL' => acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/pro/', 'ACF upgrade', 'field-type-selection' ),
129 'PROFieldTypes' => acf_get_pro_field_types(), 129 'PROFieldTypes' => acf_get_pro_field_types(),
130 'PROLocationTypes' => array(
131 'block' => __( 'Block', 'acf' ),
132 'options_page' => __( 'Options Page', 'acf' ),
133 ),
130 ) 134 )
131 ); 135 );
132 136
......
...@@ -81,11 +81,12 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) : ...@@ -81,11 +81,12 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
81 * @return array 81 * @return array
82 */ 82 */
83 public function admin_table_columns( $_columns ) { 83 public function admin_table_columns( $_columns ) {
84
85 // Set the "no found" label to be our custom HTML for no results. 84 // Set the "no found" label to be our custom HTML for no results.
86 global $wp_post_types; 85 if ( empty( acf_request_arg( 's' ) ) ) {
87 $this->not_found_label = $wp_post_types['acf-field-group']->labels->not_found; 86 global $wp_post_types;
88 $wp_post_types['acf-field-group']->labels->not_found = $this->get_not_found_html(); 87 $this->not_found_label = $wp_post_types['acf-field-group']->labels->not_found;
88 $wp_post_types['acf-field-group']->labels->not_found = $this->get_not_found_html();
89 }
89 90
90 $columns = array( 91 $columns = array(
91 'cb' => $_columns['cb'], 92 'cb' => $_columns['cb'],
...@@ -124,8 +125,11 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) : ...@@ -124,8 +125,11 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
124 125
125 // Description. 126 // Description.
126 case 'acf-description': 127 case 'acf-description':
127 if ( $post['description'] ) { 128 if ( is_string( $post['description'] ) && ! empty( $post['description'] ) ) {
128 echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>'; 129 echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
130 } else {
131 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
132 echo '<span class="screen-reader-text">' . esc_html__( 'No description', 'acf' ) . '</span>';
129 } 133 }
130 break; 134 break;
131 135
...@@ -136,7 +140,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) : ...@@ -136,7 +140,7 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
136 140
137 // Count. 141 // Count.
138 case 'acf-count': 142 case 'acf-count':
139 echo esc_html( acf_get_field_count( $post ) ); 143 $this->render_admin_table_column_num_fields( $post );
140 break; 144 break;
141 145
142 // Local JSON. 146 // Local JSON.
...@@ -240,6 +244,36 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) : ...@@ -240,6 +244,36 @@ if ( ! class_exists( 'ACF_Admin_Field_Groups' ) ) :
240 } 244 }
241 245
242 /** 246 /**
247 * Renders the number of fields created for the field group in the list table.
248 *
249 * @since 6.1.5
250 *
251 * @param array $field_group The main field group array.
252 * @return void
253 */
254 public function render_admin_table_column_num_fields( $field_group ) {
255 $field_count = acf_get_field_count( $field_group );
256
257 if ( ! $field_count || ! is_numeric( $field_count ) ) {
258 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
259 echo '<span class="screen-reader-text">' . esc_html__( 'No fields', 'acf' ) . '</span>';
260 return;
261 }
262
263 // If in JSON but not synced or in trash, the link won't work.
264 if ( empty( $field_group['ID'] ) || 'trash' === get_post_status( $field_group['ID'] ) ) {
265 echo esc_html( number_format_i18n( $field_count ) );
266 return;
267 }
268
269 printf(
270 '<a href="%s">%s</a>',
271 esc_url( admin_url( 'post.php?action=edit&post=' . $field_group['ID'] ) ),
272 esc_html( number_format_i18n( $field_count ) )
273 );
274 }
275
276 /**
243 * Fires when trashing a field group. 277 * Fires when trashing a field group.
244 * 278 *
245 * @date 8/01/2014 279 * @date 8/01/2014
......
...@@ -82,10 +82,13 @@ if ( ! class_exists( 'ACF_Admin_Post_Type' ) ) : ...@@ -82,10 +82,13 @@ if ( ! class_exists( 'ACF_Admin_Post_Type' ) ) :
82 $item_saved_text = sprintf( __( '%s post type created', 'acf' ), $title ); 82 $item_saved_text = sprintf( __( '%s post type created', 'acf' ), $title );
83 } 83 }
84 84
85 $add_fields_link = wp_nonce_url( 85 $add_fields_link = wp_nonce_url(
86 admin_url( 'post-new.php?post_type=acf-field-group&use_post_type=' . $post_id ), 86 admin_url( 'post-new.php?post_type=acf-field-group&use_post_type=' . $post_id ),
87 'add-fields-' . $post_id 87 'add-fields-' . $post_id
88 ); 88 );
89
90 $create_post_type_link = admin_url( 'post-new.php?post_type=acf-post-type' );
91
89 $create_taxonomy_link = wp_nonce_url( 92 $create_taxonomy_link = wp_nonce_url(
90 admin_url( 'post-new.php?post_type=acf-taxonomy&use_post_type=' . $post_id ), 93 admin_url( 'post-new.php?post_type=acf-taxonomy&use_post_type=' . $post_id ),
91 'create-taxonomy-' . $post_id 94 'create-taxonomy-' . $post_id
...@@ -96,6 +99,7 @@ if ( ! class_exists( 'ACF_Admin_Post_Type' ) ) : ...@@ -96,6 +99,7 @@ if ( ! class_exists( 'ACF_Admin_Post_Type' ) ) :
96 <div class="acf-item-saved-links"> 99 <div class="acf-item-saved-links">
97 <a href="<?php echo esc_url( $add_fields_link ); ?>"><?php echo esc_html( $add_fields_text ); ?></a> 100 <a href="<?php echo esc_url( $add_fields_link ); ?>"><?php echo esc_html( $add_fields_text ); ?></a>
98 <a class="acf-link-field-groups" href="#"><?php esc_html_e( 'Link existing field groups', 'acf' ); ?></a> 101 <a class="acf-link-field-groups" href="#"><?php esc_html_e( 'Link existing field groups', 'acf' ); ?></a>
102 <a href="<?php echo esc_url( $create_post_type_link ); ?>"><?php esc_html_e( 'Create new post type', 'acf' ); ?></a>
99 <a href="<?php echo esc_url( $create_taxonomy_link ); ?>"><?php esc_html_e( 'Create new taxonomy', 'acf' ); ?></a> 103 <a href="<?php echo esc_url( $create_taxonomy_link ); ?>"><?php esc_html_e( 'Create new taxonomy', 'acf' ); ?></a>
100 </div> 104 </div>
101 <?php 105 <?php
......
...@@ -90,9 +90,11 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) : ...@@ -90,9 +90,11 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
90 */ 90 */
91 public function admin_table_columns( $_columns ) { 91 public function admin_table_columns( $_columns ) {
92 // Set the "no found" label to be our custom HTML for no results. 92 // Set the "no found" label to be our custom HTML for no results.
93 global $wp_post_types; 93 if ( empty( acf_request_arg( 's' ) ) ) {
94 $this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found; 94 global $wp_post_types;
95 $wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html(); 95 $this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found;
96 $wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html();
97 }
96 98
97 $columns = array( 99 $columns = array(
98 'cb' => $_columns['cb'], 100 'cb' => $_columns['cb'],
...@@ -130,8 +132,11 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) : ...@@ -130,8 +132,11 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
130 132
131 // Description. 133 // Description.
132 case 'acf-description': 134 case 'acf-description':
133 if ( $post['description'] ) { 135 if ( is_string( $post['description'] ) && ! empty( $post['description'] ) ) {
134 echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>'; 136 echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
137 } else {
138 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
139 echo '<span class="screen-reader-text">' . esc_html__( 'No description', 'acf' ) . '</span>';
135 } 140 }
136 break; 141 break;
137 142
...@@ -166,6 +171,8 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) : ...@@ -166,6 +171,8 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
166 $field_groups = acf_get_field_groups( array( 'post_type' => $post_type['post_type'] ) ); 171 $field_groups = acf_get_field_groups( array( 'post_type' => $post_type['post_type'] ) );
167 172
168 if ( empty( $field_groups ) ) { 173 if ( empty( $field_groups ) ) {
174 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
175 echo '<span class="screen-reader-text">' . esc_html__( 'No field groups', 'acf' ) . '</span>';
169 return; 176 return;
170 } 177 }
171 178
...@@ -218,6 +225,12 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) : ...@@ -218,6 +225,12 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
218 $labels[] = $taxonomy->label; 225 $labels[] = $taxonomy->label;
219 } 226 }
220 227
228 if ( empty( $labels ) ) {
229 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
230 echo '<span class="screen-reader-text">' . esc_html__( 'No taxonomies', 'acf' ) . '</span>';
231 return;
232 }
233
221 $limit = 3; 234 $limit = 3;
222 $shown_labels = array_slice( $labels, 0, $limit ); 235 $shown_labels = array_slice( $labels, 0, $limit );
223 $hidden_labels = array_slice( $labels, $limit ); 236 $hidden_labels = array_slice( $labels, $limit );
...@@ -239,8 +252,12 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) : ...@@ -239,8 +252,12 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
239 * @return void 252 * @return void
240 */ 253 */
241 public function render_admin_table_column_num_posts( $post_type ) { 254 public function render_admin_table_column_num_posts( $post_type ) {
255 $no_posts = '<span class="acf-emdash" aria-hidden="true">—</span>';
256 $no_posts .= '<span class="screen-reader-text">' . esc_html__( 'No posts', 'acf' ) . '</span>';
257
242 // WP doesn't count posts for post types that don't exist. 258 // WP doesn't count posts for post types that don't exist.
243 if ( 'trash' === get_post_status( $post_type['ID'] ) ) { 259 if ( empty( $post_type['active'] ) || 'trash' === get_post_status( $post_type['ID'] ) ) {
260 echo acf_esc_html( $no_posts );
244 return; 261 return;
245 } 262 }
246 263
...@@ -249,11 +266,16 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) : ...@@ -249,11 +266,16 @@ if ( ! class_exists( 'ACF_Admin_Post_Types' ) ) :
249 $num_posts = $num_posts->publish; 266 $num_posts = $num_posts->publish;
250 } 267 }
251 268
252 if ( ! is_numeric( $num_posts ) ) { 269 if ( ! $num_posts || ! is_numeric( $num_posts ) ) {
270 echo acf_esc_html( $no_posts );
253 return; 271 return;
254 } 272 }
255 273
256 echo esc_html( number_format_i18n( $num_posts ) ); 274 printf(
275 '<a href="%s">%s</a>',
276 esc_url( admin_url( 'edit.php?post_type=' . $post_type['post_type'] ) ),
277 esc_html( number_format_i18n( $num_posts ) )
278 );
257 } 279 }
258 280
259 /** 281 /**
......
...@@ -90,9 +90,11 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) : ...@@ -90,9 +90,11 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
90 */ 90 */
91 public function admin_table_columns( $_columns ) { 91 public function admin_table_columns( $_columns ) {
92 // Set the "no found" label to be our custom HTML for no results. 92 // Set the "no found" label to be our custom HTML for no results.
93 global $wp_post_types; 93 if ( empty( acf_request_arg( 's' ) ) ) {
94 $this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found; 94 global $wp_post_types;
95 $wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html(); 95 $this->not_found_label = $wp_post_types[ $this->post_type ]->labels->not_found;
96 $wp_post_types[ $this->post_type ]->labels->not_found = $this->get_not_found_html();
97 }
96 98
97 $columns = array( 99 $columns = array(
98 'cb' => $_columns['cb'], 100 'cb' => $_columns['cb'],
...@@ -130,8 +132,11 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) : ...@@ -130,8 +132,11 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
130 132
131 // Description. 133 // Description.
132 case 'acf-description': 134 case 'acf-description':
133 if ( $post['description'] ) { 135 if ( is_string( $post['description'] ) && ! empty( $post['description'] ) ) {
134 echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>'; 136 echo '<span class="acf-description">' . acf_esc_html( $post['description'] ) . '</span>';
137 } else {
138 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
139 echo '<span class="screen-reader-text">' . esc_html__( 'No description', 'acf' ) . '</span>';
135 } 140 }
136 break; 141 break;
137 142
...@@ -166,6 +171,8 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) : ...@@ -166,6 +171,8 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
166 $field_groups = acf_get_field_groups( array( 'taxonomy' => $taxonomy['taxonomy'] ) ); 171 $field_groups = acf_get_field_groups( array( 'taxonomy' => $taxonomy['taxonomy'] ) );
167 172
168 if ( empty( $field_groups ) ) { 173 if ( empty( $field_groups ) ) {
174 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
175 echo '<span class="screen-reader-text">' . esc_html__( 'No field groups', 'acf' ) . '</span>';
169 return; 176 return;
170 } 177 }
171 178
...@@ -221,6 +228,12 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) : ...@@ -221,6 +228,12 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
221 } 228 }
222 } 229 }
223 230
231 if ( empty( $labels ) ) {
232 echo '<span class="acf-emdash" aria-hidden="true">—</span>';
233 echo '<span class="screen-reader-text">' . esc_html__( 'No post types', 'acf' ) . '</span>';
234 return;
235 }
236
224 $labels = array_unique( $labels ); 237 $labels = array_unique( $labels );
225 $limit = 3; 238 $limit = 3;
226 $shown_labels = array_slice( $labels, 0, $limit ); 239 $shown_labels = array_slice( $labels, 0, $limit );
...@@ -243,8 +256,12 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) : ...@@ -243,8 +256,12 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
243 * @return void 256 * @return void
244 */ 257 */
245 public function render_admin_table_column_num_terms( $taxonomy ) { 258 public function render_admin_table_column_num_terms( $taxonomy ) {
259 $no_terms = '<span class="acf-emdash" aria-hidden="true">—</span>';
260 $no_terms .= '<span class="screen-reader-text">' . esc_html__( 'No terms', 'acf' ) . '</span>';
261
246 // WP doesn't count terms for taxonomies that don't exist and instead returns WP_Error. 262 // WP doesn't count terms for taxonomies that don't exist and instead returns WP_Error.
247 if ( 'trash' === get_post_status( $taxonomy['ID'] ) ) { 263 if ( empty( $taxonomy['active'] ) || 'trash' === get_post_status( $taxonomy['ID'] ) ) {
264 echo acf_esc_html( $no_terms );
248 return; 265 return;
249 } 266 }
250 267
...@@ -256,11 +273,16 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) : ...@@ -256,11 +273,16 @@ if ( ! class_exists( 'ACF_Admin_Taxonomies' ) ) :
256 ) 273 )
257 ); 274 );
258 275
259 if ( ! is_numeric( $num_terms ) ) { 276 if ( ! $num_terms || ! is_numeric( $num_terms ) ) {
277 echo acf_esc_html( $no_terms );
260 return; 278 return;
261 } 279 }
262 280
263 echo esc_html( number_format_i18n( $num_terms ) ); 281 printf(
282 '<a href="%s">%s</a>',
283 esc_url( admin_url( 'edit-tags.php?taxonomy=' . $taxonomy['taxonomy'] ) ),
284 esc_html( number_format_i18n( $num_terms ) )
285 );
264 } 286 }
265 287
266 /** 288 /**
......
...@@ -82,10 +82,13 @@ if ( ! class_exists( 'ACF_Admin_Taxonomy' ) ) : ...@@ -82,10 +82,13 @@ if ( ! class_exists( 'ACF_Admin_Taxonomy' ) ) :
82 $item_saved_text = sprintf( __( '%s taxonomy created', 'acf' ), $title ); 82 $item_saved_text = sprintf( __( '%s taxonomy created', 'acf' ), $title );
83 } 83 }
84 84
85 $add_fields_link = wp_nonce_url( 85 $add_fields_link = wp_nonce_url(
86 admin_url( 'post-new.php?post_type=acf-field-group&use_taxonomy=' . $post_id ), 86 admin_url( 'post-new.php?post_type=acf-field-group&use_taxonomy=' . $post_id ),
87 'add-fields-' . $post_id 87 'add-fields-' . $post_id
88 ); 88 );
89
90 $create_taxonomy_link = admin_url( 'post-new.php?post_type=acf-taxonomy' );
91
89 $create_post_type_link = wp_nonce_url( 92 $create_post_type_link = wp_nonce_url(
90 admin_url( 'post-new.php?post_type=acf-post-type&use_taxonomy=' . $post_id ), 93 admin_url( 'post-new.php?post_type=acf-post-type&use_taxonomy=' . $post_id ),
91 'create-post-type-' . $post_id 94 'create-post-type-' . $post_id
...@@ -96,6 +99,7 @@ if ( ! class_exists( 'ACF_Admin_Taxonomy' ) ) : ...@@ -96,6 +99,7 @@ if ( ! class_exists( 'ACF_Admin_Taxonomy' ) ) :
96 <div class="acf-item-saved-links"> 99 <div class="acf-item-saved-links">
97 <a href="<?php echo esc_url( $add_fields_link ); ?>"><?php echo esc_html( $add_fields_text ); ?></a> 100 <a href="<?php echo esc_url( $add_fields_link ); ?>"><?php echo esc_html( $add_fields_text ); ?></a>
98 <a class="acf-link-field-groups" href="#"><?php esc_html_e( 'Link existing field groups', 'acf' ); ?></a> 101 <a class="acf-link-field-groups" href="#"><?php esc_html_e( 'Link existing field groups', 'acf' ); ?></a>
102 <a href="<?php echo esc_url( $create_taxonomy_link ); ?>"><?php esc_html_e( 'Create new taxonomy', 'acf' ); ?></a>
99 <a href="<?php echo esc_url( $create_post_type_link ); ?>"><?php esc_html_e( 'Create new post type', 'acf' ); ?></a> 103 <a href="<?php echo esc_url( $create_post_type_link ); ?>"><?php esc_html_e( 'Create new post type', 'acf' ); ?></a>
100 </div> 104 </div>
101 <?php 105 <?php
......
...@@ -415,13 +415,41 @@ if ( ! class_exists( 'ACF_Admin_Tool_Export' ) ) : ...@@ -415,13 +415,41 @@ if ( ! class_exists( 'ACF_Admin_Tool_Export' ) ) :
415 // Prevent default translation and fake __() within string. 415 // Prevent default translation and fake __() within string.
416 acf_update_setting( 'l10n_var_export', true ); 416 acf_update_setting( 'l10n_var_export', true );
417 417
418 $json = $this->get_selected(); 418 $json = $this->get_selected();
419 419 $to_export = array();
420 echo '<textarea id="acf-export-textarea" readonly="true">';
421 420
421 // Sort by ACF post type first so we can wrap them in related functions.
422 foreach ( $json as $post ) { 422 foreach ( $json as $post ) {
423 $post_type = acf_determine_internal_post_type( $post['key'] ); 423 $post_type = acf_determine_internal_post_type( $post['key'] );
424 echo acf_export_internal_post_type_as_php( $post, $post_type ); 424
425 if ( $post_type ) {
426 $to_export[ $post_type ][] = $post;
427 }
428 }
429
430 echo '<textarea id="acf-export-textarea" readonly="readonly">';
431
432 foreach ( $to_export as $post_type => $posts ) {
433 if ( 'acf-field-group' === $post_type ) {
434 echo "add_action( 'acf/include_fields', function() {\r\n";
435 echo "\tif ( ! function_exists( 'acf_add_local_field_group' ) ) {\r\n\t\treturn;\r\n\t}\r\n\r\n";
436 } elseif ( 'acf-post-type' === $post_type || 'acf-taxonomy' === $post_type ) {
437 echo "add_action( 'init', function() {\r\n";
438 }
439
440 $count = 0;
441 foreach ( $posts as $post ) {
442 if ( $count !== 0 ) {
443 echo "\r\n";
444 }
445
446 echo "\t" . acf_export_internal_post_type_as_php( $post, $post_type ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- esc_textarea() used earlier.
447 $count++;
448 }
449
450 if ( in_array( $post_type, array( 'acf-post-type', 'acf-taxonomy', 'acf-field-group' ), true ) ) {
451 echo "} );\r\n\r\n";
452 }
425 } 453 }
426 454
427 echo '</textarea>'; 455 echo '</textarea>';
......
...@@ -114,6 +114,10 @@ if ( isset( $field['conditional_logic'] ) && is_array( $field['conditional_logic ...@@ -114,6 +114,10 @@ if ( isset( $field['conditional_logic'] ) && is_array( $field['conditional_logic
114 <?php 114 <?php
115 switch ( $tab_key ) { 115 switch ( $tab_key ) {
116 case 'general': 116 case 'general':
117 $field_type_select_class = 'field-type';
118 if ( ! apply_filters( 'acf/field_group/enable_field_type_select2', true ) ) {
119 $field_type_select_class .= ' disable-select2';
120 }
117 // type 121 // type
118 acf_render_field_setting( 122 acf_render_field_setting(
119 $field, 123 $field,
...@@ -123,7 +127,7 @@ if ( isset( $field['conditional_logic'] ) && is_array( $field['conditional_logic ...@@ -123,7 +127,7 @@ if ( isset( $field['conditional_logic'] ) && is_array( $field['conditional_logic
123 'type' => 'select', 127 'type' => 'select',
124 'name' => 'type', 128 'name' => 'type',
125 'choices' => acf_get_grouped_field_types(), 129 'choices' => acf_get_grouped_field_types(),
126 'class' => 'field-type', 130 'class' => $field_type_select_class,
127 ), 131 ),
128 true 132 true
129 ); 133 );
......
...@@ -11,7 +11,6 @@ $prefix = 'acf_field_group[location][' . $rule['group'] . '][' . $rule['id'] . ' ...@@ -11,7 +11,6 @@ $prefix = 'acf_field_group[location][' . $rule['group'] . '][' . $rule['id'] . '
11 // vars 11 // vars
12 $choices = acf_get_location_rule_types(); 12 $choices = acf_get_location_rule_types();
13 13
14
15 // array 14 // array
16 if ( is_array( $choices ) ) { 15 if ( is_array( $choices ) ) {
17 16
......
...@@ -17,38 +17,31 @@ if ( empty( $field_group['location'] ) ) { ...@@ -17,38 +17,31 @@ if ( empty( $field_group['location'] ) ) {
17 ), 17 ),
18 ); 18 );
19 19
20 $acf_use_post_type = acf_request_arg( 'use_post_type', false ); 20 $acf_use_post_type = acf_get_post_type_from_request_args( 'add-fields' );
21 if ( $acf_use_post_type && wp_verify_nonce( acf_request_arg( '_wpnonce' ), 'add-fields-' . $acf_use_post_type ) ) { 21 $acf_use_taxonomy = acf_get_taxonomy_from_request_args( 'add-fields' );
22 $acf_post_type = acf_get_internal_post_type( (int) $acf_use_post_type, 'acf-post-type' );
23 22
24 if ( $acf_post_type && isset( $acf_post_type['post_type'] ) ) { 23 if ( $acf_use_post_type && ! empty( $acf_use_post_type['post_type'] ) ) {
25 $field_group['location'] = array( 24 $field_group['location'] = array(
25 array(
26 array( 26 array(
27 array( 27 'param' => 'post_type',
28 'param' => 'post_type', 28 'operator' => '==',
29 'operator' => '==', 29 'value' => $acf_use_post_type['post_type'],
30 'value' => $acf_post_type['post_type'],
31 ),
32 ), 30 ),
33 ); 31 ),
34 } 32 );
35 } 33 }
36 34
37 $acf_use_taxonomy = acf_request_arg( 'use_taxonomy', false ); 35 if ( $acf_use_taxonomy && ! empty( $acf_use_taxonomy['taxonomy'] ) ) {
38 if ( $acf_use_taxonomy && wp_verify_nonce( acf_request_arg( '_wpnonce' ), 'add-fields-' . $acf_use_taxonomy ) ) { 36 $field_group['location'] = array(
39 $acf_taxonomy = acf_get_internal_post_type( (int) $acf_use_taxonomy, 'acf-taxonomy' ); 37 array(
40
41 if ( $acf_taxonomy && isset( $acf_taxonomy['taxonomy'] ) ) {
42 $field_group['location'] = array(
43 array( 38 array(
44 array( 39 'param' => 'taxonomy',
45 'param' => 'taxonomy', 40 'operator' => '==',
46 'operator' => '==', 41 'value' => $acf_use_taxonomy['taxonomy'],
47 'value' => $acf_taxonomy['taxonomy'],
48 ),
49 ), 42 ),
50 ); 43 ),
51 } 44 );
52 } 45 }
53 } 46 }
54 47
...@@ -248,6 +241,18 @@ foreach ( acf_get_combined_field_group_settings_tabs() as $tab_key => $tab_label ...@@ -248,6 +241,18 @@ foreach ( acf_get_combined_field_group_settings_tabs() as $tab_key => $tab_label
248 'div', 241 'div',
249 'field' 242 'field'
250 ); 243 );
244
245 /* translators: 1: Post creation date 2: Post creation time */
246 $acf_created_on = sprintf( __( 'Created on %1$s at %2$s', 'acf' ), get_the_date(), get_the_time() );
247 ?>
248 <div class="acf-field-group-settings-footer">
249 <span class="acf-created-on"><?php echo esc_html( $acf_created_on ); ?></span>
250 <a href="<?php echo get_delete_post_link(); ?>" class="acf-btn acf-btn-tertiary acf-delete-field-group">
251 <i class="acf-icon acf-icon-trash"></i>
252 <?php esc_html_e( 'Delete Field Group', 'acf' ); ?>
253 </a>
254 </div>
255 <?php
251 echo '</div>'; 256 echo '</div>';
252 break; 257 break;
253 default: 258 default:
...@@ -260,17 +265,7 @@ foreach ( acf_get_combined_field_group_settings_tabs() as $tab_key => $tab_label ...@@ -260,17 +265,7 @@ foreach ( acf_get_combined_field_group_settings_tabs() as $tab_key => $tab_label
260 265
261 // 3rd party settings 266 // 3rd party settings
262 do_action( 'acf/render_field_group_settings', $field_group ); 267 do_action( 'acf/render_field_group_settings', $field_group );
263
264 /* translators: 1: Post creation date 2: Post creation time */
265 $acf_created_on = sprintf( __( 'Created on %1$s at %2$s', 'acf' ), get_the_date(), get_the_time() );
266 ?> 268 ?>
267 <div class="acf-field-group-settings-footer">
268 <span class="acf-created-on"><?php echo esc_html( $acf_created_on ); ?></span>
269 <a href="<?php echo get_delete_post_link(); ?>" class="acf-btn acf-btn-tertiary acf-delete-field-group">
270 <i class="acf-icon acf-icon-trash"></i>
271 <?php esc_html_e( 'Delete Field Group', 'acf' ); ?>
272 </a>
273 </div>
274 269
275 <div class="acf-hidden"> 270 <div class="acf-hidden">
276 <input type="hidden" name="acf_field_group[key]" value="<?php echo $field_group['key']; ?>" /> 271 <input type="hidden" name="acf_field_group[key]" value="<?php echo $field_group['key']; ?>" />
......
...@@ -2,16 +2,6 @@ ...@@ -2,16 +2,6 @@
2 2
3 global $acf_post_type; 3 global $acf_post_type;
4 4
5 // Allow preselecting the linked taxonomies based on previously created taxonomy.
6 $acf_use_taxonomy = acf_request_arg( 'use_taxonomy', false );
7 if ( $acf_use_taxonomy && wp_verify_nonce( acf_request_arg( '_wpnonce' ), 'create-post-type-' . $acf_use_taxonomy ) ) {
8 $acf_linked_taxonomy = acf_get_internal_post_type( (int) $acf_use_taxonomy, 'acf-taxonomy' );
9
10 if ( $acf_linked_taxonomy && isset( $acf_linked_taxonomy['taxonomy'] ) ) {
11 $acf_post_type['taxonomies'] = array( $acf_linked_taxonomy['taxonomy'] );
12 }
13 }
14
15 foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label ) { 5 foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label ) {
16 acf_render_field_wrap( 6 acf_render_field_wrap(
17 array( 7 array(
...@@ -23,26 +13,6 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label ) ...@@ -23,26 +13,6 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
23 13
24 switch ( $tab_key ) { 14 switch ( $tab_key ) {
25 case 'general': 15 case 'general':
26 acf_render_field_wrap(
27 array(
28 'type' => 'select',
29 'name' => 'taxonomies',
30 'key' => 'taxonomies',
31 'prefix' => 'acf_post_type',
32 'value' => $acf_post_type['taxonomies'],
33 'label' => __( 'Linked Taxonomies', 'acf' ),
34 'instructions' => __( 'Select existing taxonomies to classify items of the post type.', 'acf' ),
35 'choices' => acf_get_taxonomy_labels(),
36 'ui' => true,
37 'allow_null' => true,
38 'multiple' => true,
39 ),
40 'div',
41 'field'
42 );
43
44 acf_render_field_wrap( array( 'type' => 'seperator' ) );
45
46 $acf_available_supports = array( 16 $acf_available_supports = array(
47 'title' => __( 'Title', 'acf' ), 17 'title' => __( 'Title', 'acf' ),
48 'author' => __( 'Author', 'acf' ), 18 'author' => __( 'Author', 'acf' ),
...@@ -1053,7 +1023,7 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label ) ...@@ -1053,7 +1023,7 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
1053 'name' => 'with_front', 1023 'name' => 'with_front',
1054 'key' => 'with_front', 1024 'key' => 'with_front',
1055 'prefix' => 'acf_post_type[rewrite]', 1025 'prefix' => 'acf_post_type[rewrite]',
1056 'value' => $acf_post_type['rewrite']['with_front'], 1026 'value' => isset( $acf_post_type['rewrite']['with_front'] ) ? $acf_post_type['rewrite']['with_front'] : true,
1057 'label' => __( 'Front URL Prefix', 'acf' ), 1027 'label' => __( 'Front URL Prefix', 'acf' ),
1058 'instructions' => __( 'Alters the permalink structure to add the `WP_Rewrite::$front` prefix to URLs.', 'acf' ), 1028 'instructions' => __( 'Alters the permalink structure to add the `WP_Rewrite::$front` prefix to URLs.', 'acf' ),
1059 'ui' => true, 1029 'ui' => true,
...@@ -1072,7 +1042,7 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label ) ...@@ -1072,7 +1042,7 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
1072 'name' => 'feeds', 1042 'name' => 'feeds',
1073 'key' => 'feeds', 1043 'key' => 'feeds',
1074 'prefix' => 'acf_post_type[rewrite]', 1044 'prefix' => 'acf_post_type[rewrite]',
1075 'value' => $acf_post_type['rewrite']['feeds'], 1045 'value' => isset( $acf_post_type['rewrite']['feeds'] ) ? $acf_post_type['rewrite']['feeds'] : $acf_post_type['has_archive'],
1076 'label' => __( 'Feed URL', 'acf' ), 1046 'label' => __( 'Feed URL', 'acf' ),
1077 'instructions' => __( 'RSS feed URL for the post type items.', 'acf' ), 1047 'instructions' => __( 'RSS feed URL for the post type items.', 'acf' ),
1078 'ui' => true, 1048 'ui' => true,
...@@ -1090,7 +1060,7 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label ) ...@@ -1090,7 +1060,7 @@ foreach ( acf_get_combined_post_type_settings_tabs() as $tab_key => $tab_label )
1090 'name' => 'pages', 1060 'name' => 'pages',
1091 'key' => 'pages', 1061 'key' => 'pages',
1092 'prefix' => 'acf_post_type[rewrite]', 1062 'prefix' => 'acf_post_type[rewrite]',
1093 'value' => $acf_post_type['rewrite']['pages'], 1063 'value' => isset( $acf_post_type['rewrite']['pages'] ) ? $acf_post_type['rewrite']['pages'] : true,
1094 'label' => __( 'Pagination', 'acf' ), 1064 'label' => __( 'Pagination', 'acf' ),
1095 'instructions' => __( 'Pagination support for the items URLs such as the archives.', 'acf' ), 1065 'instructions' => __( 'Pagination support for the items URLs such as the archives.', 'acf' ),
1096 'ui' => true, 1066 'ui' => true,
......
...@@ -54,6 +54,30 @@ acf_render_field_wrap( ...@@ -54,6 +54,30 @@ acf_render_field_wrap(
54 'field' 54 'field'
55 ); 55 );
56 56
57 // Allow preselecting the linked taxonomies based on previously created taxonomy.
58 $acf_use_taxonomy = acf_get_taxonomy_from_request_args( 'create-post-type' );
59 if ( $acf_use_taxonomy && ! empty( $acf_use_taxonomy['taxonomy'] ) ) {
60 $acf_post_type['taxonomies'] = array( $acf_use_taxonomy['taxonomy'] );
61 }
62
63 acf_render_field_wrap(
64 array(
65 'type' => 'select',
66 'name' => 'taxonomies',
67 'key' => 'taxonomies',
68 'prefix' => 'acf_post_type',
69 'value' => $acf_post_type['taxonomies'],
70 'label' => __( 'Taxonomies', 'acf' ),
71 'instructions' => __( 'Select existing taxonomies to classify items of the post type.', 'acf' ),
72 'choices' => acf_get_taxonomy_labels(),
73 'ui' => true,
74 'allow_null' => true,
75 'multiple' => true,
76 ),
77 'div',
78 'field'
79 );
80
57 acf_render_field_wrap( array( 'type' => 'seperator' ) ); 81 acf_render_field_wrap( array( 'type' => 'seperator' ) );
58 82
59 acf_render_field_wrap( 83 acf_render_field_wrap(
......
...@@ -56,13 +56,9 @@ acf_render_field_wrap( ...@@ -56,13 +56,9 @@ acf_render_field_wrap(
56 ); 56 );
57 57
58 // Allow preselecting the linked post types based on previously created post type. 58 // Allow preselecting the linked post types based on previously created post type.
59 $acf_use_post_type = acf_request_arg( 'use_post_type', false ); 59 $acf_use_post_type = acf_get_post_type_from_request_args( 'create-taxonomy' );
60 if ( $acf_use_post_type && wp_verify_nonce( acf_request_arg( '_wpnonce' ), 'create-taxonomy-' . $acf_use_post_type ) ) { 60 if ( $acf_use_post_type && ! empty( $acf_use_post_type['post_type'] ) ) {
61 $acf_linked_post_type = acf_get_internal_post_type( (int) $acf_use_post_type, 'acf-post-type' ); 61 $acf_taxonomy['object_type'] = array( $acf_use_post_type['post_type'] );
62
63 if ( $acf_linked_post_type && isset( $acf_linked_post_type['post_type'] ) ) {
64 $acf_taxonomy['object_type'] = array( $acf_linked_post_type['post_type'] );
65 }
66 } 62 }
67 63
68 acf_render_field_wrap( 64 acf_render_field_wrap(
......
1 <?php 1 <?php
2 global $title, $post_new_file, $post_type_object, $post; 2 global $title, $post_new_file, $post_type_object, $post;
3 $acf_title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post ); 3 $acf_title_placeholder = apply_filters( 'enter_title_here', __( 'Add title' ), $post );
4 $acf_title = $post->post_title;
4 $acf_post_type = is_object( $post_type_object ) ? $post_type_object->name : ''; 5 $acf_post_type = is_object( $post_type_object ) ? $post_type_object->name : '';
5 $acf_publish_btn_name = 'save'; 6 $acf_publish_btn_name = 'save';
6 7
7 if ( 'publish' !== $post->post_status ) { 8 if ( 'publish' !== $post->post_status ) {
8 $acf_publish_btn_name = 'publish'; 9 $acf_publish_btn_name = 'publish';
9 } 10 }
11
12 if ( 'acf-field-group' === $acf_post_type ) {
13 $acf_use_post_type = acf_get_post_type_from_request_args( 'add-fields' );
14 $acf_use_taxonomy = acf_get_taxonomy_from_request_args( 'add-fields' );
15
16 /* translators: %s - singular label of post type/taxonomy, i.e. "Movie"/"Genre" */
17 $acf_prefilled_title = (string) apply_filters( 'acf/field_group/prefill_title', __( '%s fields', 'acf' ) );
18
19 if ( $acf_use_post_type && ! empty( $acf_use_post_type['labels']['singular_name'] ) ) {
20 $acf_prefilled_title = sprintf( $acf_prefilled_title, $acf_use_post_type['labels']['singular_name'] );
21 } elseif ( $acf_use_taxonomy && ! empty( $acf_use_taxonomy['labels']['singular_name'] ) ) {
22 $acf_prefilled_title = sprintf( $acf_prefilled_title, $acf_use_taxonomy['labels']['singular_name'] );
23 } else {
24 $acf_prefilled_title = false;
25 }
26
27 if ( empty( $acf_title ) && $acf_prefilled_title ) {
28 $acf_title = $acf_prefilled_title;
29 }
30 }
10 ?> 31 ?>
11 <div class="acf-headerbar acf-headerbar-field-editor"> 32 <div class="acf-headerbar acf-headerbar-field-editor">
12 <div class="acf-headerbar-inner"> 33 <div class="acf-headerbar-inner">
...@@ -19,8 +40,8 @@ if ( 'publish' !== $post->post_status ) { ...@@ -19,8 +40,8 @@ if ( 'publish' !== $post->post_status ) {
19 </h1> 40 </h1>
20 <?php if ( 'acf-field-group' === $acf_post_type ) : ?> 41 <?php if ( 'acf-field-group' === $acf_post_type ) : ?>
21 <div class="acf-title-wrap"> 42 <div class="acf-title-wrap">
22 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $acf_title_placeholder; ?></label> 43 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo esc_html( $acf_title_placeholder ); ?></label>
23 <input form="post" type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" class="acf-headerbar-title-field" spellcheck="true" autocomplete="off" placeholder="<?php esc_attr_e( 'Field Group Title', 'acf' ); ?>" /> 44 <input form="post" type="text" name="post_title" size="30" value="<?php echo esc_attr( $acf_title ); ?>" id="title" class="acf-headerbar-title-field" spellcheck="true" autocomplete="off" placeholder="<?php esc_attr_e( 'Field Group Title', 'acf' ); ?>" />
24 </div> 45 </div>
25 <?php endif; ?> 46 <?php endif; ?>
26 </div> 47 </div>
......
...@@ -852,6 +852,7 @@ if ( ! class_exists( 'ACF_Internal_Post_Type' ) ) { ...@@ -852,6 +852,7 @@ if ( ! class_exists( 'ACF_Internal_Post_Type' ) ) {
852 } 852 }
853 853
854 $str_replace = array( 854 $str_replace = array(
855 "\n" => "\n\t",
855 ' ' => "\t", 856 ' ' => "\t",
856 "'!!__(!!\'" => "__('", 857 "'!!__(!!\'" => "__('",
857 "!!\', !!\'" => "', '", 858 "!!\', !!\'" => "', '",
......
...@@ -461,6 +461,7 @@ function acf_get_pro_field_types() { ...@@ -461,6 +461,7 @@ function acf_get_pro_field_types() {
461 'doc_url' => acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/gallery/', 'docs', 'field-type-selection' ), 461 'doc_url' => acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/gallery/', 'docs', 'field-type-selection' ),
462 'preview_image' => acf_get_url() . '/assets/images/field-type-previews/field-preview-gallery.png', 462 'preview_image' => acf_get_url() . '/assets/images/field-type-previews/field-preview-gallery.png',
463 'description' => __( 'This provides an interactive interface for managing a collection of attachments. Most settings are similar to the Image field type. Additional settings allow you to specify where new attachments are added in the gallery and the minimum/maximum number of attachments allowed.', 'acf' ), 463 'description' => __( 'This provides an interactive interface for managing a collection of attachments. Most settings are similar to the Image field type. Additional settings allow you to specify where new attachments are added in the gallery and the minimum/maximum number of attachments allowed.', 'acf' ),
464 'tutorial_url' => acf_add_url_utm_tags( 'https://www.advancedcustomfields.com/resources/how-to-use-the-gallery-field/', 'docs', 'field-type-selection' ),
464 'category' => 'content', 465 'category' => 'content',
465 'pro' => true, 466 'pro' => true,
466 ), 467 ),
......
...@@ -610,10 +610,10 @@ if ( ! class_exists( 'acf_field_checkbox' ) ) : ...@@ -610,10 +610,10 @@ if ( ! class_exists( 'acf_field_checkbox' ) ) :
610 */ 610 */
611 public function get_rest_schema( array $field ) { 611 public function get_rest_schema( array $field ) {
612 $schema = array( 612 $schema = array(
613 'type' => array( 'string', 'array', 'null' ), 613 'type' => array( 'integer', 'string', 'array', 'null' ),
614 'required' => isset( $field['required'] ) && $field['required'], 614 'required' => isset( $field['required'] ) && $field['required'],
615 'items' => array( 615 'items' => array(
616 'type' => 'string', 616 'type' => array( 'string', 'integer' ),
617 ), 617 ),
618 ); 618 );
619 619
...@@ -631,11 +631,17 @@ if ( ! class_exists( 'acf_field_checkbox' ) ) : ...@@ -631,11 +631,17 @@ if ( ! class_exists( 'acf_field_checkbox' ) ) :
631 * we should use the keys for the available options to POST to, 631 * we should use the keys for the available options to POST to,
632 * since they are what is displayed in GET requests. 632 * since they are what is displayed in GET requests.
633 */ 633 */
634 $checkbox_keys = array_diff( 634 $checkbox_keys = array_map(
635 array_keys( $field['choices'] ), 635 'strval',
636 array_values( $field['choices'] ) 636 array_diff(
637 array_keys( $field['choices'] ),
638 array_values( $field['choices'] )
639 )
637 ); 640 );
638 641
642 // Support users passing integers for the keys as well.
643 $checkbox_keys = array_merge( $checkbox_keys, array_map( 'intval', array_keys( $field['choices'] ) ) );
644
639 $schema['items']['enum'] = empty( $checkbox_keys ) ? $field['choices'] : $checkbox_keys; 645 $schema['items']['enum'] = empty( $checkbox_keys ) ? $field['choices'] : $checkbox_keys;
640 646
641 return $schema; 647 return $schema;
......
...@@ -121,10 +121,6 @@ if ( ! class_exists( 'acf_field_page_link' ) ) : ...@@ -121,10 +121,6 @@ if ( ! class_exists( 'acf_field_page_link' ) ) :
121 121
122 $args['post_status'] = acf_get_array( $field['post_status'] ); 122 $args['post_status'] = acf_get_array( $field['post_status'] );
123 123
124 } else {
125
126 $args['post_status'] = 'publish';
127
128 } 124 }
129 125
130 // create tax queries 126 // create tax queries
...@@ -485,7 +481,7 @@ if ( ! class_exists( 'acf_field_page_link' ) ) : ...@@ -485,7 +481,7 @@ if ( ! class_exists( 'acf_field_page_link' ) ) :
485 'multiple' => 1, 481 'multiple' => 1,
486 'ui' => 1, 482 'ui' => 1,
487 'allow_null' => 1, 483 'allow_null' => 1,
488 'placeholder' => __( 'Published', 'acf' ), 484 'placeholder' => __( 'Any post status', 'acf' ),
489 ) 485 )
490 ); 486 );
491 487
......
...@@ -146,10 +146,6 @@ if ( ! class_exists( 'acf_field_post_object' ) ) : ...@@ -146,10 +146,6 @@ if ( ! class_exists( 'acf_field_post_object' ) ) :
146 146
147 $args['post_status'] = acf_get_array( $field['post_status'] ); 147 $args['post_status'] = acf_get_array( $field['post_status'] );
148 148
149 } else {
150
151 $args['post_status'] = 'publish';
152
153 } 149 }
154 150
155 // taxonomy 151 // taxonomy
...@@ -397,7 +393,7 @@ if ( ! class_exists( 'acf_field_post_object' ) ) : ...@@ -397,7 +393,7 @@ if ( ! class_exists( 'acf_field_post_object' ) ) :
397 'multiple' => 1, 393 'multiple' => 1,
398 'ui' => 1, 394 'ui' => 1,
399 'allow_null' => 1, 395 'allow_null' => 1,
400 'placeholder' => __( 'Published', 'acf' ), 396 'placeholder' => __( 'Any post status', 'acf' ),
401 ) 397 )
402 ); 398 );
403 399
......
...@@ -180,10 +180,6 @@ if ( ! class_exists( 'acf_field_relationship' ) ) : ...@@ -180,10 +180,6 @@ if ( ! class_exists( 'acf_field_relationship' ) ) :
180 180
181 $args['post_status'] = acf_get_array( $field['post_status'] ); 181 $args['post_status'] = acf_get_array( $field['post_status'] );
182 182
183 } else {
184
185 $args['post_status'] = acf_get_post_stati();
186
187 } 183 }
188 184
189 // taxonomy 185 // taxonomy
...@@ -609,7 +605,7 @@ if ( ! class_exists( 'acf_field_relationship' ) ) : ...@@ -609,7 +605,7 @@ if ( ! class_exists( 'acf_field_relationship' ) ) :
609 'multiple' => 1, 605 'multiple' => 1,
610 'ui' => 1, 606 'ui' => 1,
611 'allow_null' => 1, 607 'allow_null' => 1,
612 'placeholder' => __( 'Published', 'acf' ), 608 'placeholder' => __( 'Any post status', 'acf' ),
613 ) 609 )
614 ); 610 );
615 611
......
...@@ -436,16 +436,13 @@ if ( ! class_exists( 'ACF_Field_Group' ) ) { ...@@ -436,16 +436,13 @@ if ( ! class_exists( 'ACF_Field_Group' ) ) {
436 return $return; 436 return $return;
437 } 437 }
438 438
439 $code = var_export( $post, true ); 439 $code = var_export( $post, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions -- Used for PHP export.
440 if ( ! $code ) { 440 if ( ! $code ) {
441 return $return; 441 return $return;
442 } 442 }
443 443
444 $code = $this->format_code_for_export( $code ); 444 $code = $this->format_code_for_export( $code );
445 445 $return .= "acf_add_local_field_group( {$code} );\r\n";
446 $return .= "if ( function_exists('acf_add_local_field_group') ):\r\n\r\n";
447 $return .= "acf_add_local_field_group({$code});\r\n\r\n";
448 $return .= "endif;\r\n\r\n";
449 446
450 return esc_textarea( $return ); 447 return esc_textarea( $return );
451 } 448 }
......
...@@ -383,7 +383,7 @@ if ( ! class_exists( 'ACF_Post_Type' ) ) { ...@@ -383,7 +383,7 @@ if ( ! class_exists( 'ACF_Post_Type' ) ) {
383 383
384 // WordPress defaults to the opposite of $args['public']. 384 // WordPress defaults to the opposite of $args['public'].
385 $exclude_from_search = (bool) $post['exclude_from_search']; 385 $exclude_from_search = (bool) $post['exclude_from_search'];
386 if ( $exclude_from_search !== $args['public'] ) { 386 if ( $exclude_from_search === $args['public'] ) {
387 $args['exclude_from_search'] = $exclude_from_search; 387 $args['exclude_from_search'] = $exclude_from_search;
388 } 388 }
389 389
...@@ -597,7 +597,7 @@ if ( ! class_exists( 'ACF_Post_Type' ) ) { ...@@ -597,7 +597,7 @@ if ( ! class_exists( 'ACF_Post_Type' ) ) {
597 // Validate and prepare the post for export. 597 // Validate and prepare the post for export.
598 $post = $this->validate_post( $post ); 598 $post = $this->validate_post( $post );
599 $args = $this->get_post_type_args( $post ); 599 $args = $this->get_post_type_args( $post );
600 $code = var_export( $args, true ); 600 $code = var_export( $args, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions -- Used for PHP export.
601 601
602 if ( ! $code ) { 602 if ( ! $code ) {
603 return $return; 603 return $return;
...@@ -605,7 +605,7 @@ if ( ! class_exists( 'ACF_Post_Type' ) ) { ...@@ -605,7 +605,7 @@ if ( ! class_exists( 'ACF_Post_Type' ) ) {
605 605
606 $code = $this->format_code_for_export( $code ); 606 $code = $this->format_code_for_export( $code );
607 607
608 $return .= "register_post_type( '{$post_type_key}', {$code} );\r\n\r\n"; 608 $return .= "register_post_type( '{$post_type_key}', {$code} );\r\n";
609 609
610 return esc_textarea( $return ); 610 return esc_textarea( $return );
611 } 611 }
......
...@@ -487,9 +487,9 @@ if ( ! class_exists( 'ACF_Taxonomy' ) ) { ...@@ -487,9 +487,9 @@ if ( ! class_exists( 'ACF_Taxonomy' ) ) {
487 $post = $this->validate_post( $post ); 487 $post = $this->validate_post( $post );
488 $taxonomy_key = $post['taxonomy']; 488 $taxonomy_key = $post['taxonomy'];
489 $objects = (array) $post['object_type']; 489 $objects = (array) $post['object_type'];
490 $objects = var_export( $objects, true ); 490 $objects = var_export( $objects, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions -- Used for PHP export.
491 $args = $this->get_taxonomy_args( $post ); 491 $args = $this->get_taxonomy_args( $post );
492 $args = var_export( $args, true ); 492 $args = var_export( $args, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions -- Used for PHP export.
493 493
494 if ( ! $args ) { 494 if ( ! $args ) {
495 return $return; 495 return $return;
...@@ -498,7 +498,7 @@ if ( ! class_exists( 'ACF_Taxonomy' ) ) { ...@@ -498,7 +498,7 @@ if ( ! class_exists( 'ACF_Taxonomy' ) ) {
498 $args = $this->format_code_for_export( $args ); 498 $args = $this->format_code_for_export( $args );
499 $objects = $this->format_code_for_export( $objects ); 499 $objects = $this->format_code_for_export( $objects );
500 500
501 $return .= "register_taxonomy('{$taxonomy_key}', $objects, {$args} );\r\n\r\n"; 501 $return .= "register_taxonomy( '{$taxonomy_key}', {$objects}, {$args} );\r\n";
502 502
503 return esc_textarea( $return ); 503 return esc_textarea( $return );
504 } 504 }
......
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.
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.