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.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.10 4.4.11 4.4.12 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 5.10 5.10.1 5.10.2 5.11 5.11.1 5.11.2 5.11.3 5.11.4 5.12 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.6.10 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 5.6.8 5.6.9 5.7.0 5.7.1 5.7.10 5.7.12 5.7.13 5.7.2 5.7.3 5.7.4 5.7.5 5.7.6 5.7.7 5.7.8 5.7.9 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.2 5.8.3 5.8.4
advanced-custom-fields / includes / locations / class-acf-location-post-format.php
advanced-custom-fields / includes / locations Last commit date
abstract-acf-legacy-location.php 3 months ago abstract-acf-location.php 3 months ago class-acf-location-attachment.php 3 months ago class-acf-location-comment.php 3 months ago class-acf-location-current-user-role.php 3 months ago class-acf-location-current-user.php 3 months ago class-acf-location-nav-menu-item.php 3 months ago class-acf-location-nav-menu.php 3 months ago class-acf-location-page-parent.php 3 months ago class-acf-location-page-template.php 3 months ago class-acf-location-page-type.php 3 months ago class-acf-location-page.php 3 months ago class-acf-location-post-category.php 3 months ago class-acf-location-post-format.php 3 months ago class-acf-location-post-status.php 3 months ago class-acf-location-post-taxonomy.php 3 months ago class-acf-location-post-template.php 3 months ago class-acf-location-post-type.php 3 months ago class-acf-location-post.php 3 months ago class-acf-location-taxonomy.php 3 months ago class-acf-location-user-form.php 3 months ago class-acf-location-user-role.php 3 months ago class-acf-location-widget.php 3 months ago index.php 1 year ago
class-acf-location-post-format.php
85 lines
1 <?php
2 /**
3 * @package ACF
4 * @author WP Engine
5 *
6 * © 2026 Advanced Custom Fields (ACF®). All rights reserved.
7 * "ACF" is a trademark of WP Engine.
8 * Licensed under the GNU General Public License v2 or later.
9 * https://www.gnu.org/licenses/gpl-2.0.html
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 if ( ! class_exists( 'ACF_Location_Post_Format' ) ) :
17
18 class ACF_Location_Post_Format extends ACF_Location {
19
20 /**
21 * Initializes props.
22 *
23 * @date 5/03/2014
24 * @since 5.0.0
25 *
26 * @param void
27 * @return void
28 */
29 public function initialize() {
30 $this->name = 'post_format';
31 $this->label = __( 'Post Format', 'acf' );
32 $this->category = 'post';
33 $this->object_type = 'post';
34 }
35
36 /**
37 * Matches the provided rule against the screen args returning a bool result.
38 *
39 * @date 9/4/20
40 * @since 5.9.0
41 *
42 * @param array $rule The location rule.
43 * @param array $screen The screen args.
44 * @param array $field_group The field group settings.
45 * @return boolean
46 */
47 public function match( $rule, $screen, $field_group ) {
48
49 // Check screen args.
50 if ( isset( $screen['post_format'] ) ) {
51 $post_format = $screen['post_format'];
52 } elseif ( isset( $screen['post_id'] ) ) {
53 $post_type = get_post_type( $screen['post_id'] );
54 $post_format = get_post_format( $screen['post_id'] );
55
56 // Treat new posts (that support post-formats) without a saved format as "standard".
57 if ( ! $post_format && post_type_supports( $post_type, 'post-formats' ) ) {
58 $post_format = 'standard';
59 }
60 } else {
61 return false;
62 }
63
64 // Compare rule against $post_format.
65 return $this->compare_to_rule( $post_format, $rule );
66 }
67
68 /**
69 * Returns an array of possible values for this rule type.
70 *
71 * @date 9/4/20
72 * @since 5.9.0
73 *
74 * @param array $rule A location rule.
75 * @return array
76 */
77 public function get_values( $rule ) {
78 return get_post_format_strings();
79 }
80 }
81
82 // initialize
83 acf_register_location_type( 'ACF_Location_Post_Format' );
84 endif; // class_exists check
85