PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.5.7
Secure Custom Fields v6.5.7
6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / includes / fields / class-acf-field-post_object.php
secure-custom-fields / includes / fields Last commit date
FlexibleContent 10 months ago class-acf-field-accordion.php 1 year ago class-acf-field-button-group.php 1 year ago class-acf-field-checkbox.php 10 months ago class-acf-field-clone.php 10 months ago class-acf-field-color_picker.php 1 year ago class-acf-field-date_picker.php 10 months ago class-acf-field-date_time_picker.php 10 months ago class-acf-field-email.php 1 year ago class-acf-field-file.php 1 year ago class-acf-field-flexible-content.php 10 months ago class-acf-field-gallery.php 1 year ago class-acf-field-google-map.php 10 months ago class-acf-field-group.php 10 months ago class-acf-field-icon_picker.php 10 months ago class-acf-field-image.php 1 year ago class-acf-field-link.php 1 year ago class-acf-field-message.php 1 year ago class-acf-field-nav-menu.php 1 year ago class-acf-field-number.php 1 year ago class-acf-field-oembed.php 10 months ago class-acf-field-output.php 1 year ago class-acf-field-page_link.php 10 months ago class-acf-field-password.php 1 year ago class-acf-field-post_object.php 10 months ago class-acf-field-radio.php 1 year ago class-acf-field-range.php 1 year ago class-acf-field-relationship.php 10 months ago class-acf-field-repeater.php 1 year ago class-acf-field-select.php 1 year ago class-acf-field-separator.php 1 year ago class-acf-field-tab.php 1 year ago class-acf-field-taxonomy.php 1 year ago class-acf-field-text.php 1 year ago class-acf-field-textarea.php 1 year ago class-acf-field-time_picker.php 1 year ago class-acf-field-true_false.php 1 year ago class-acf-field-url.php 1 year ago class-acf-field-user.php 1 year ago class-acf-field-wysiwyg.php 1 year ago class-acf-field.php 10 months ago class-acf-repeater-table.php 1 year ago index.php 1 year ago
class-acf-field-post_object.php
767 lines
1 <?php
2
3 if ( ! class_exists( 'acf_field_post_object' ) ) :
4
5 class acf_field_post_object extends acf_field {
6
7
8
9 /**
10 * This function will setup the field type data
11 *
12 * @since ACF 5.0.0
13 */
14 public function initialize() {
15 $this->name = 'post_object';
16 $this->label = __( 'Post Object', 'secure-custom-fields' );
17 $this->category = 'relational';
18 $this->description = __( 'An interactive and customizable UI for picking one or many posts, pages or post type items with the option to search. ', 'secure-custom-fields' );
19 $this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-post-object.png';
20 $this->doc_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/post-object/';
21 $this->tutorial_url = 'https://developer.wordpress.org/secure-custom-fields/features/fields/post-object/post-object-tutorial/';
22 $this->defaults = array(
23 'post_type' => array(),
24 'taxonomy' => array(),
25 'allow_null' => 0,
26 'multiple' => 0,
27 'return_format' => 'object',
28 'ui' => 1,
29 'bidirectional_target' => array(),
30 );
31
32 // extra
33 add_action( 'wp_ajax_acf/fields/post_object/query', array( $this, 'ajax_query' ) );
34 add_action( 'wp_ajax_nopriv_acf/fields/post_object/query', array( $this, 'ajax_query' ) );
35 add_filter( 'acf/conditional_logic/choices', array( $this, 'render_field_post_object_conditional_choices' ), 10, 3 );
36 }
37
38 /**
39 * Filters choices in post object conditions.
40 *
41 * @since ACF 6.3
42 *
43 * @param array $choices The selected choice.
44 * @param array $conditional_field The conditional field settings object.
45 * @param string $rule_value The rule value.
46 * @return array
47 */
48 public function render_field_post_object_conditional_choices( $choices, $conditional_field, $rule_value ) {
49 if ( ! is_array( $conditional_field ) || $conditional_field['type'] !== 'post_object' ) {
50 return $choices;
51 }
52 if ( ! empty( $rule_value ) ) {
53 $post_title = esc_html( get_the_title( $rule_value ) );
54 $choices = array( $rule_value => $post_title );
55 }
56 return $choices;
57 }
58
59 /**
60 * AJAX query handler for post object fields.
61 *
62 * @since ACF 5.0.0
63 *
64 * @return void
65 */
66 public function ajax_query() {
67 $nonce = acf_request_arg( 'nonce', '' );
68 $key = acf_request_arg( 'field_key', '' );
69 $conditional_logic = (bool) acf_request_arg( 'conditional_logic', false );
70
71 if ( $conditional_logic ) {
72 if ( ! acf_current_user_can_admin() ) {
73 die();
74 }
75
76 // Use the standard ACF admin nonce.
77 $nonce = '';
78 $key = '';
79 }
80
81 if ( ! acf_verify_ajax( $nonce, $key ) ) {
82 die();
83 }
84
85 acf_send_ajax_results( $this->get_ajax_query( $_POST ) );
86 }
87
88 /**
89 * This function will return an array of data formatted for use in a select2 AJAX response
90 *
91 * @since ACF 5.0.9
92 *
93 * @param array $options The options being queried for the ajax request.
94 * @return array|boolean The AJAX response array, or false on failure.
95 */
96 public function get_ajax_query( $options = array() ) {
97 // defaults
98 $options = acf_parse_args(
99 $options,
100 array(
101 'post_id' => 0,
102 's' => '',
103 'field_key' => '',
104 'paged' => 1,
105 'include' => '',
106 )
107 );
108
109 // load field
110 $field = acf_get_field( $options['field_key'] );
111 if ( ! $field ) {
112 return false;
113 }
114
115 // vars
116 $results = array();
117 $args = array();
118 $s = false;
119 $is_search = false;
120
121 // paged
122 $args['posts_per_page'] = 20;
123 $args['paged'] = $options['paged'];
124
125 // search
126 if ( $options['s'] !== '' ) {
127
128 // strip slashes (search may be integer)
129 $s = wp_unslash( strval( $options['s'] ) );
130
131 // update vars
132 $args['s'] = $s;
133 $is_search = true;
134 }
135
136 if ( ! empty( $options['include'] ) ) {
137 $args['include'] = $options['include'];
138 }
139
140 // post_type
141 if ( ! empty( $field['post_type'] ) ) {
142 $args['post_type'] = acf_get_array( $field['post_type'] );
143 } else {
144 $args['post_type'] = acf_get_post_types();
145 }
146
147 // post status
148 if ( ! empty( $options['post_status'] ) ) {
149 $args['post_status'] = acf_get_array( $options['post_status'] );
150 } elseif ( ! empty( $field['post_status'] ) ) {
151 $args['post_status'] = acf_get_array( $field['post_status'] );
152 }
153
154 // If there is an include set, we will unset search to avoid attempting to further filter by the search term.
155 if ( isset( $args['include'] ) ) {
156 unset( $args['s'] );
157 }
158
159 // taxonomy
160 if ( ! empty( $field['taxonomy'] ) ) {
161
162 // vars
163 $terms = acf_decode_taxonomy_terms( $field['taxonomy'] );
164
165 // append to $args
166 $args['tax_query'] = array();
167
168 // now create the tax queries
169 foreach ( $terms as $k => $v ) {
170 $args['tax_query'][] = array(
171 'taxonomy' => $k,
172 'field' => 'slug',
173 'terms' => $v,
174 );
175 }
176 }
177
178 // filters
179 $args = apply_filters( 'acf/fields/post_object/query', $args, $field, $options['post_id'] );
180 $args = apply_filters( 'acf/fields/post_object/query/name=' . $field['name'], $args, $field, $options['post_id'] );
181 $args = apply_filters( 'acf/fields/post_object/query/key=' . $field['key'], $args, $field, $options['post_id'] );
182
183 // get posts grouped by post type
184 $groups = acf_get_grouped_posts( $args );
185
186 // bail early if no posts
187 if ( empty( $groups ) ) {
188 return false;
189 }
190
191 // loop
192 foreach ( array_keys( $groups ) as $group_title ) {
193
194 // vars
195 $posts = acf_extract_var( $groups, $group_title );
196
197 // data
198 $data = array(
199 'text' => $group_title,
200 'children' => array(),
201 );
202
203 // convert post objects to post titles
204 foreach ( array_keys( $posts ) as $post_id ) {
205 $posts[ $post_id ] = $this->get_post_title( $posts[ $post_id ], $field, $options['post_id'], $is_search, true );
206 }
207
208 // order posts by search
209 if ( $is_search && empty( $args['orderby'] ) && isset( $args['s'] ) ) {
210 $posts = acf_order_by_search( $posts, $args['s'] );
211 }
212
213 // append to $data
214 foreach ( array_keys( $posts ) as $post_id ) {
215 $data['children'][] = $this->get_post_result( $post_id, $posts[ $post_id ] );
216 }
217
218 // append to $results
219 $results[] = $data;
220 }
221
222 // optgroup or single
223 $post_type = acf_get_array( $args['post_type'] );
224 if ( count( $post_type ) == 1 ) {
225 $results = $results[0]['children'];
226 }
227
228 // vars
229 $response = array(
230 'results' => $results,
231 'limit' => $args['posts_per_page'],
232 );
233
234 // return
235 return $response;
236 }
237
238 /**
239 * This function will return an array containing id, text and maybe description data
240 *
241 * @since ACF 5.4.0
242 *
243 * @param mixed $id The ID of the post result.
244 * @param string $text The text for the response item.
245 * @return array The combined result array.
246 */
247 public function get_post_result( $id, $text ) {
248
249 // vars
250 $result = array(
251 'id' => $id,
252 'text' => $text,
253 );
254
255 // look for parent
256 $search = '| ' . __( 'Parent', 'secure-custom-fields' ) . ':';
257 $pos = strpos( $text, $search );
258
259 if ( $pos !== false ) {
260 $result['description'] = substr( $text, $pos + 2 );
261 $result['text'] = substr( $text, 0, $pos );
262 }
263
264 // return
265 return $result;
266 }
267
268
269 /**
270 * This function post object's filtered output post title
271 *
272 * @since ACF 5.0.0
273 *
274 * @param WP_Post $post The WordPress post.
275 * @param array $field The field being output.
276 * @param integer $post_id The post_id to which this value is saved to.
277 * @param integer $is_search An int-as-boolean value for whether we're performing a search.
278 * @param boolean $unescape Should we return an unescaped post title.
279 * @return string A potentially user filtered post title for the post, which may contain unsafe HTML.
280 */
281 public function get_post_title( $post, $field, $post_id = 0, $is_search = 0, $unescape = false ) {
282
283 // get post_id
284 if ( ! $post_id ) {
285 $post_id = acf_get_form_data( 'post_id' );
286 }
287
288 // vars
289 $title = acf_get_post_title( $post, $is_search );
290
291 // unescape for select2 output which handles the escaping.
292 if ( $unescape ) {
293 $title = html_entity_decode( $title );
294 }
295
296 // filters
297 $title = apply_filters( 'acf/fields/post_object/result', $title, $post, $field, $post_id );
298 $title = apply_filters( 'acf/fields/post_object/result/name=' . $field['_name'], $title, $post, $field, $post_id );
299 $title = apply_filters( 'acf/fields/post_object/result/key=' . $field['key'], $title, $post, $field, $post_id );
300
301 // return untrusted output.
302 return $title;
303 }
304
305
306 /**
307 * Create the HTML interface for the post object field.
308 *
309 * @since ACF 3.6
310 *
311 * @param array $field An array holding all the field's data.
312 * @return void
313 */
314 public function render_field( $field ) {
315 // Change Field into a select
316 $field['type'] = 'select';
317 $field['ui'] = 1;
318 $field['ajax'] = 1;
319 $field['nonce'] = wp_create_nonce( $field['key'] );
320 $field['choices'] = array();
321
322 // load posts
323 $posts = $this->get_posts( $field['value'], $field );
324
325 if ( $posts ) {
326 foreach ( array_keys( $posts ) as $i ) {
327
328 // vars
329 $post = acf_extract_var( $posts, $i );
330
331 // append to choices
332 $field['choices'][ $post->ID ] = $this->get_post_title( $post, $field );
333 }
334 }
335
336 // render
337 acf_render_field( $field );
338 }
339
340
341 /**
342 * Create extra options for post object field. This is rendered when editing.
343 * The value of $field['name'] can be used (like below) to save extra data to the $field.
344 *
345 * @since ACF 3.6
346 *
347 * @param array $field An array holding all the field's data.
348 */
349 public function render_field_settings( $field ) {
350 acf_render_field_setting(
351 $field,
352 array(
353 'label' => __( 'Filter by Post Type', 'secure-custom-fields' ),
354 'instructions' => '',
355 'type' => 'select',
356 'name' => 'post_type',
357 'choices' => acf_get_pretty_post_types(),
358 'multiple' => 1,
359 'ui' => 1,
360 'allow_null' => 1,
361 'placeholder' => __( 'All post types', 'secure-custom-fields' ),
362 )
363 );
364
365 acf_render_field_setting(
366 $field,
367 array(
368 'label' => __( 'Filter by Post Status', 'secure-custom-fields' ),
369 'instructions' => '',
370 'type' => 'select',
371 'name' => 'post_status',
372 'choices' => acf_get_pretty_post_statuses(),
373 'multiple' => 1,
374 'ui' => 1,
375 'allow_null' => 1,
376 'placeholder' => __( 'Any post status', 'secure-custom-fields' ),
377 )
378 );
379
380 acf_render_field_setting(
381 $field,
382 array(
383 'label' => __( 'Filter by Taxonomy', 'secure-custom-fields' ),
384 'instructions' => '',
385 'type' => 'select',
386 'name' => 'taxonomy',
387 'choices' => acf_get_taxonomy_terms(),
388 'multiple' => 1,
389 'ui' => 1,
390 'allow_null' => 1,
391 'placeholder' => __( 'All taxonomies', 'secure-custom-fields' ),
392 )
393 );
394
395 acf_render_field_setting(
396 $field,
397 array(
398 'label' => __( 'Return Format', 'secure-custom-fields' ),
399 'instructions' => '',
400 'type' => 'radio',
401 'name' => 'return_format',
402 'choices' => array(
403 'object' => __( 'Post Object', 'secure-custom-fields' ),
404 'id' => __( 'Post ID', 'secure-custom-fields' ),
405 ),
406 'layout' => 'horizontal',
407 )
408 );
409
410 acf_render_field_setting(
411 $field,
412 array(
413 'label' => __( 'Select Multiple', 'secure-custom-fields' ),
414 'instructions' => 'Allow content editors to select multiple values',
415 'name' => 'multiple',
416 'type' => 'true_false',
417 'ui' => 1,
418 )
419 );
420 }
421
422 /**
423 * Renders the field settings used in the "Validation" tab.
424 *
425 * @since ACF 6.0
426 *
427 * @param array $field The field settings array.
428 * @return void
429 */
430 public function render_field_validation_settings( $field ) {
431 acf_render_field_setting(
432 $field,
433 array(
434 'label' => __( 'Allow Null', 'secure-custom-fields' ),
435 'instructions' => '',
436 'name' => 'allow_null',
437 'type' => 'true_false',
438 'ui' => 1,
439 )
440 );
441 }
442
443 /**
444 * Renders the field settings used in the "Advanced" tab.
445 *
446 * @since ACF 6.2
447 *
448 * @param array $field The field settings array.
449 * @return void
450 */
451 public function render_field_advanced_settings( $field ) {
452 acf_render_bidirectional_field_settings( $field );
453 }
454
455 /**
456 * This filter is applied to the $value after it is loaded from the db
457 *
458 * @since ACF 3.6
459 *
460 * @param mixed $value The value found in the database
461 * @param mixed $post_id The post_id from which the value was loaded
462 * @param array $field The field array holding all the field options
463 * @return mixed $value
464 */
465 public function load_value( $value, $post_id, $field ) {
466
467 // ACF4 null
468 if ( $value === 'null' ) {
469 return false;
470 }
471
472 // return
473 return $value;
474 }
475
476
477 /**
478 * This filter is applied to the $value after it is loaded from the db and before it is returned to the template
479 *
480 * @since ACF 3.6
481 *
482 * @param mixed $value The value found in the database
483 * @param mixed $post_id The post_id from which the value was loaded
484 * @param array $field The field array holding all the field options
485 * @return mixed $value
486 */
487 public function format_value( $value, $post_id, $field ) {
488 $value = acf_get_numeric( $value );
489
490 // bail early if no value
491 if ( empty( $value ) ) {
492 return false;
493 }
494
495 // load posts if needed
496 if ( $field['return_format'] == 'object' ) {
497 $value = $this->get_posts( $value, $field );
498 }
499
500 // convert back from array if necessary
501 if ( ! $field['multiple'] && is_array( $value ) ) {
502 $value = current( $value );
503 }
504
505 // return value
506 return $value;
507 }
508
509
510 /**
511 * Filters the field value before it is saved into the database.
512 *
513 * @since ACF 3.6
514 *
515 * @param mixed $value The value which will be saved in the database.
516 * @param integer $post_id The post_id of which the value will be saved.
517 * @param array $field The field array holding all the field options.
518 * @return mixed $value The modified value.
519 */
520 public function update_value( $value, $post_id, $field ) {
521
522 // Bail early if no value.
523 if ( empty( $value ) ) {
524 acf_update_bidirectional_values( array(), $post_id, $field );
525 return $value;
526 }
527
528 // Format array of values.
529 // - ensure each value is an id.
530 // - Parse each id as string for SQL LIKE queries.
531 if ( acf_is_sequential_array( $value ) ) {
532 $value = array_map( 'acf_idval', $value );
533 $value = array_map( 'strval', $value );
534
535 // Parse single value for id.
536 } else {
537 $value = acf_idval( $value );
538 }
539
540 acf_update_bidirectional_values( acf_get_array( $value ), $post_id, $field );
541
542 return $value;
543 }
544
545
546 /**
547 * This function will return an array of posts for a given field value
548 *
549 * @since ACF 5.0
550 *
551 * @param mixed $value The value of the field.
552 * @param array $field The field array holding all the field options.
553 * @return array $value An array of post objects.
554 */
555 public function get_posts( $value, $field ) {
556
557 // numeric
558 $value = acf_get_numeric( $value );
559
560 // bail early if no value
561 if ( empty( $value ) ) {
562 return false;
563 }
564
565 // get posts
566 $posts = acf_get_posts(
567 array(
568 'post__in' => $value,
569 'post_type' => $field['post_type'],
570 )
571 );
572
573 // return
574 return $posts;
575 }
576
577 /**
578 * Validates post object fields updated via the REST API.
579 *
580 * @since ACF 5.11
581 *
582 * @param boolean $valid The current validity boolean.
583 * @param integer $value The value of the field.
584 * @param array $field The field array.
585 * @return boolean|WP_Error
586 */
587 public function validate_rest_value( $valid, $value, $field ) {
588 if ( is_null( $value ) ) {
589 return $valid;
590 }
591
592 $param = sprintf( '%s[%s]', $field['prefix'], $field['name'] );
593 $data = array( 'param' => $param );
594 $value = is_array( $value ) ? $value : array( $value );
595
596 $invalid_posts = array();
597 $post_type_errors = array();
598 $taxonomy_errors = array();
599
600 foreach ( $value as $post_id ) {
601 if ( is_string( $post_id ) ) {
602 continue;
603 }
604
605 $post_type = get_post_type( $post_id );
606 if ( ! $post_type ) {
607 $invalid_posts[] = $post_id;
608 continue;
609 }
610
611 if (
612 is_array( $field['post_type'] ) &&
613 ! empty( $field['post_type'] ) &&
614 ! in_array( $post_type, $field['post_type'] )
615 ) {
616 $post_type_errors[] = $post_id;
617 }
618
619 if ( is_array( $field['taxonomy'] ) && ! empty( $field['taxonomy'] ) ) {
620 $found = false;
621 foreach ( $field['taxonomy'] as $taxonomy_term ) {
622 $decoded = acf_decode_taxonomy_term( $taxonomy_term );
623 if ( $decoded && is_object_in_term( $post_id, $decoded['taxonomy'], $decoded['term'] ) ) {
624 $found = true;
625 break;
626 }
627 }
628
629 if ( ! $found ) {
630 $taxonomy_errors[] = $post_id;
631 }
632 }
633 }
634
635 if ( count( $invalid_posts ) ) {
636 $error = sprintf(
637 /* translators: %s: field name */
638 __( '%1$s must have a valid post ID.', 'secure-custom-fields' ),
639 $param
640 );
641 $data['value'] = $invalid_posts;
642 return new WP_Error( 'rest_invalid_param', $error, $data );
643 }
644
645 if ( count( $post_type_errors ) ) {
646 $error = sprintf(
647 /* translators: 1: field name, 2: post type */
648 _n(
649 '%1$s must be of post type %2$s.',
650 '%1$s must be of one of the following post types: %2$s',
651 count( $field['post_type'] ),
652 'secure-custom-fields'
653 ),
654 $param,
655 count( $field['post_type'] ) > 1 ? implode( ', ', $field['post_type'] ) : $field['post_type'][0]
656 );
657 $data['value'] = $post_type_errors;
658
659 return new WP_Error( 'rest_invalid_param', $error, $data );
660 }
661
662 if ( count( $taxonomy_errors ) ) {
663 $error = sprintf(
664 /* translators: 1: field name, 2: taxonomy term */
665 _n(
666 '%1$s must have term %2$s.',
667 '%1$s must have one of the following terms: %2$s',
668 count( $field['taxonomy'] ),
669 'secure-custom-fields'
670 ),
671 $param,
672 count( $field['taxonomy'] ) > 1 ? implode( ', ', $field['taxonomy'] ) : $field['taxonomy'][0]
673 );
674 $data['value'] = $taxonomy_errors;
675
676 return new WP_Error( 'rest_invalid_param', $error, $data );
677 }
678
679 return $valid;
680 }
681
682 /**
683 * Return the schema array for the REST API.
684 *
685 * @since ACF 5.11
686 *
687 * @param array $field The field array.
688 * @return array
689 */
690 public function get_rest_schema( array $field ) {
691 $schema = array(
692 'type' => array( 'integer', 'array', 'null' ),
693 'required' => ! empty( $field['required'] ),
694 'items' => array(
695 'type' => 'integer',
696 ),
697 );
698
699 if ( empty( $field['allow_null'] ) ) {
700 $schema['minItems'] = 1;
701 }
702
703 if ( empty( $field['multiple'] ) ) {
704 $schema['maxItems'] = 1;
705 }
706
707 return $schema;
708 }
709
710 /**
711 * REST link attributes generator for this field.
712 *
713 * @since ACF 5.11
714 * @see \acf_field::get_rest_links()
715 *
716 * @param mixed $value The raw (unformatted) field value.
717 * @param integer|string $post_id The post ID being queried.
718 * @param array $field The field array.
719 * @return array
720 */
721 public function get_rest_links( $value, $post_id, array $field ) {
722 $links = array();
723
724 if ( empty( $value ) ) {
725 return $links;
726 }
727
728 foreach ( (array) $value as $object_id ) {
729 if ( ! $post_type = get_post_type( $object_id ) ) {
730 continue;
731 }
732
733 if ( ! $post_type_object = get_post_type_object( $post_type ) ) {
734 continue;
735 }
736
737 $rest_base = acf_get_object_type_rest_base( $post_type_object );
738 $links[] = array(
739 'rel' => $post_type_object->name === 'attachment' ? 'acf:attachment' : 'acf:post',
740 'href' => rest_url( sprintf( '/wp/v2/%s/%s', $rest_base, $object_id ) ),
741 'embeddable' => true,
742 );
743 }
744
745 return $links;
746 }
747
748 /**
749 * Apply basic formatting to prepare the value for default REST output.
750 *
751 * @since ACF 5.11
752 *
753 * @param mixed $value The raw (unformatted) field value.
754 * @param integer|string $post_id The post ID being queried.
755 * @param array $field The field array.
756 * @return mixed
757 */
758 public function format_value_for_rest( $value, $post_id, array $field ) {
759 return acf_format_numerics( $value );
760 }
761 }
762
763
764 // initialize
765 acf_register_field_type( 'acf_field_post_object' );
766 endif; // class_exists check
767